During any data migration work or during production/non-productions work, you may want to copy table data from one database to another database. Below steps can be followed to generate insert statement from one SQL Server database table and can be easily copied to another SQL Server database table.

Right click on database –>Task –>Generate Scripts

Click Next

Choose option "Select specific database objects" if you want to generate insert statement for specific object. Here, we will choose table "student" to generate insert statement. Click Next.

Click on Advanced option

Now, scroll below and search for option "Types of data to script" and choose option "Data only" to generate insert statement. Choose "Schema and data" if you want to generate object schema along with insert statement. for now, we will select Data only option and click OK.

Next, click on "Open in new query Window" if you want to take the output in new window. then click Next — > Next — > Finish

Save Script completed successfully.

Sample Output:

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.