SQL SERVER GENERATE SCRIPTs

SQL SERVER has GENERATE SCRIPT command can export vendor’s database schema and data to the client’s SQL SERVER. Besides, GENERATE SCRIPT also provides various customized options. For example, you can check whether the client’s SQL Server already has the same schema table compared to the vendor’s. You can also choose whether you just want to export your database’s data to the client side or also includes table’s schema. This article will introduce how to use SQL SERVER GENERATE SCRIPT command.

Step 1: right click the database you want to export to the client side. Choose task and generate script

Step 2: choose the table and the store procedure you want to export

Step 3: choose to save script in the computer’s disk or show them on the SQL Server script new widnow. Advanced item offers the user advanced options. For example, you can decide to save your generate script into what SQL Server version you want. You can decide only to export your database’s data to the client side or you can choose to export both database’s table schema as well as data. You can also check whether the client database’s tables already has the same schema’s table.

Check SQL SERVER version.

Select to export data or table’s schema

Check whether the table already exists in the database exported.

sys.objects defines object’s information. Object can be table, view, store procedure or trigger, etc. To wrap up, this article introduces SQL SERVER generate scripts and some advanced options. By understanding how to use SQL SERVER GENERATE SCRIPTS command, you can reduce time spent on exporting database information to others dramatically.