November 15, 2013 at 2:12 pm
I am looking for the best and simplest solution to quickly replicate data in the same table. e.g. I have 100 sample records in my table, how can I copy & paste in the same table to make the total records of number 10000?
Thanks.
November 15, 2013 at 2:17 pm
halifaxdal (11/15/2013)
I am looking for the best and simplest solution to quickly replicate data in the same table. e.g. I have 100 sample records in my table, how can I copy & paste in the same table to make the total records of number 10000?Thanks.
If you have 100 rows already and you don't care if the data is duplicated the easiest way is to simply use a cross join.
Select *
from YourTableWith100Rows a
cross join YourTableWith100Rows b
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply