Click here to Skip to main content
15,914,488 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I need to copy a database from sql2000 to another system. I tried using Generate scripts option but it only copied the database structure with all the tables. But I need to copy the tables along with the data that has been entered. How do i do this?
Posted

sp_generate_inserts is not standard installed with SQL. You can find it here[^].

PS.
aspdotnetdev did also include this link.
 
Share this answer
 
v2
I've found sp_generate_inserts to be a quick and dirty way of copying data from one system to another. It's just a stored procedure that generates INSERT statements from the data in one database so you can execute those INSERTs in another database. Once you generate the structure of the database, you'd just need to use that stored procedure to copy over the data. Example usage:
SQL
EXEC sp_generate_inserts 'MyFirstTable'
EXEC sp_generate_inserts 'MySecondTable'
 
Share this answer
 
Where do I need to use these scripts

EXEC sp_generate_inserts 'MyFirstTable'
EXEC sp_generate_inserts 'MySecondTable'

I added this at the end of the generated sql script but its giving
Could not find stored procedure 'sp_generate_inserts' error
 
Share this answer
 
I created that stored procedure which is given in that link but no luck :(
still the same error
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900