• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

SQL Create Table Scripts Automatically

Using SQL Management Studio, I know you can right-click a table -> Script table as -> Create To -> New Query Editor Window and then I can save that as a .sql file but how can I automate this?

For example, when I start a new project, I want to be able to run a script that will generate all of the table creation scripts for me so I can back them up in the documentation folder.
0
twcadmin
Asked:
twcadmin
  • 2
1 Solution
 
Philip PinnellCommented:
You can right click the database -> tasks-> generate scripts

this allows you to choose to script all tables . Not quite automatic but perhaps would help
0
 
twcadminAuthor Commented:
This is very automatic. I was able to choose an options to create a new file for each object. It's not scriptable as far as I know but accomplishes when I am trying to do! Thanks!
0
 
Philip PinnellCommented:
Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now