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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inserting a row multiple times???

Author  Topic 

jakubsnm
Starting Member

3 Posts

Posted - 2011-11-17 : 15:32:42
Hi,

I'm absolutely new to SQL and would like some help inserting a row multiple times. My table is here [url]http://imageshack.us/photo/my-images/836/sqlwh.jpg/[/url] I'd like to copy row 1 into the table 23152 times. Is this possible?

I think I wouldn't have to insert the id because it's auto incremental...

Could someone please help me out with the query?

Thanks guys and gals

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2011-11-17 : 15:36:08
INSERT INTO yourtable
SELECT column1value, column2value, column3 value
GO 23152

http://connectsql.blogspot.com/2010/12/sql-server-magic-of-go-command.html

--------------------------
http://connectsql.com/
Go to Top of Page

jakubsnm
Starting Member

3 Posts

Posted - 2011-11-17 : 16:20:07
That didn't work for me I got the following error...

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '23152' at line 3
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2011-11-17 : 17:19:37
oooooops. You are using MySQL. But its an SQL Server forum.

--------------------------
http://connectsql.com/
Go to Top of Page
   

- Advertisement -