As developers we often need to move data between SQL Server instances. Some of the time database backups are fine for this, because you want to move everything. But on occasion what you need is a SQL script which can insert some rows of data you had on another server for you. And when I find myself needing this feature, I also find myself having to google how to do it. So to help my memory, here's how to generate scripts for your data:
url copied!
Then click "Next".
You may have other settings you want to make here - but this is the important one. And then you can click OK.
And finally, click "Finish" to close the wizard.And that will get you a script file which inclues
INSERT
statements for all the data rows in your chosen table(s). You can then edit that script to be contain just the data you need, or add in other bits and pieces as required.
It's pretty simple. I'm not sure why I always have so much trouble remembering how to do this - other than blundering around trying to work out why I can't find a sensibly named option on the individual tables. But no excuses now...
↑ Back to top