Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sadbjp
INNER JOIN
41 Posts |
Posted - 2007-05-01 : 18:24:00
|
| Hi All,I have a table "Person" that has two columns "FirstName" and "LastName".How can I insert multiple rows into this table using the INSERT stsmt.I want to use just one insert statement.Thanks in advance,Vishal S |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-01 : 18:26:09
|
[code]insert into Person (FirstName, LastName)select 'a', 'b' inner joinselect 'c', 'd'[/code] KH |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-01 : 18:27:08
|
| INSERT Person (FirstName, LastName)SELECT FirstName, LastNameFROM Table2Peter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-05-02 : 01:51:19
|
quote: Originally posted by khtan
insert into Person (FirstName, LastName)select 'a', 'b' inner joinselect 'c', 'd'
Tired? I think INNER JOIN should be an UNION ALL, right?Peter LarssonHelsingborg, Sweden |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-02 : 02:56:16
|
quote: Originally posted by Peso
quote: Originally posted by khtan
insert into Person (FirstName, LastName)select 'a', 'b' inner joinselect 'c', 'd'
Tired? I think INNER JOIN should be an UNION ALL, right?Peter LarssonHelsingborg, Sweden
You are right . Yeah tired. Not enough sleep last night. KH |
 |
|
|
|
|
|
|
|