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 |
|
Buzzard724
Yak Posting Veteran
66 Posts |
Posted - 2009-08-13 : 10:01:57
|
| I have the following error messageMsg 102, Level 15, State 1, Line 2Incorrect syntax near ','.when I run this code - not at all sure why the syntax is incorrectCreate TABLE TestPostMap(Post VARCHAR (300), SIRCode VARCHAR (5)); Insert into TestPostMap(Post, SIRCode)Values ('Artistic Director', '01'),('Assistant Management Accountant', '12'),('Assistant Management Accountant', '12') |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-08-13 : 10:05:33
|
| Insert into TestPostMap(Post, SIRCode)Values ('Artistic Director', '01')Insert into TestPostMap(Post, SIRCode)('Assistant Management Accountant', '12')Insert into TestPostMap(Post, SIRCode)('Assistant Management Accountant', '12')Or use SELECT ... UNION instead of VALUES |
 |
|
|
rocknpop
Posting Yak Master
201 Posts |
Posted - 2009-08-13 : 10:22:47
|
| Hi Buzzard724, it seems you are using sql 2008 syntax in sql 2000/2005. For sql 08 it seems fine. For 2000/2005 you could follow Yellowbug's reply.--------------------Rock n Roll with SQL |
 |
|
|
Buzzard724
Yak Posting Veteran
66 Posts |
Posted - 2009-08-13 : 11:22:10
|
| ah! now I understand - will do the repeating statement route in 2005 - thank you both for your help and the distinction about 2008 syntax |
 |
|
|
|
|
|
|
|