SQL Server Management Studio offers the following:
The script for the entire database:
- In the Object Explorer, right-click on the database and select
Script Database as
In a script, only (specific) tables:
- In the object explorer, right-click the database, select
Tasks , then Generate Scripts , and then select the tables you want.
Then you can use the script to create a new database / new objects elsewhere. If you change the database name, be sure to change the USE xxx statement accordingly.
Stuartlc
source share