Many a times you feel the need to script databases, tables, stored procedures etc. But you already have these utilities that help you to script these database objects. There is no script generator for the data present in the table. For e.g. you want to move data from one server to another, to accomplish this you have the script generator for table but not for data within it.
There is an Add-on for the SQL Management studio that helps you to generate the Table data scripts. You can download the add-in from here.
- After installing, when you right-click on a table node in Management Studio, you will see a “Script Data for [table name] option in the menu.
- Selecting this will bring up a dialog letting you choose a few file options (File, Clipboard, New Query Window) and a few script options. (Disable Constraints, Triggers, etc…)
This add-in works best for tables with small amounts of data. If you have a large amount of data then you should use the “Script to File” option, as you are likely to run out of memory.