SQL Server: How do I generate the table schema and populate it with inserts in a script?

Posted by Paula DiTallo on Geeks with Blogs See other posts from Geeks with Blogs or by Paula DiTallo
Published on Tue, 20 May 2014 10:46:23 GMT Indexed on 2014/05/26 21:29 UTC
Read the original article Hit count: 369

Filed under:
|

Originally posted on: http://geekswithblogs.net/AskPaula/archive/2014/05/20/156469.aspx

In SSMS, there's a Generate Script utility (read:  only available under version 2008 and up) .

Here are the steps you would need to take to make use of the utility:

  1. Right click on the database you're interested in and go to Tasks -> Generate Scripts
  2. Select the tables and/or any other objects you'd like in order to get them into the script.
  3. Navigate to Set scripting options. Click on Advanced.
  4. Under the General category, navigate to Type of data to script
  5. Select the Schema and Data option to get the insert statements generated. Click OK.


© Geeks with Blogs or respective owner

Related posts about Practical Answers

Related posts about sql