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 |
BuddyRam
Starting Member
17 Posts |
Posted - 2007-08-01 : 08:41:16
|
I have a table test with two columns testid (decimal(9)) and testname(varchar(100)). There is no identoty column or any index in the table.I want to include around 30 items in this table. How can i insert those multiple data into the table using single insert query. i used the following query INSERT INTO test (testid,testname) values ('1','Others'), ('2','Daily Express'), ('3','Daily Mail'), ('4','The Sun'), ('5','The Times'), ('6','The Star'), ('7','The Mirror'), ('8','The Independent'), ('9','The Guardian'), ('10','The Daily Telegraph'); but it is giving error. Can you give me a better solution.CheersRam |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-08-01 : 08:45:28
|
INSERT INTO test (testid,testname) Select '1','Others'union allselect '2','Daily Express'union allselect '3','Daily Mail'union all...MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|