Generate Create and insert scripts for database objects from within SSMS

In this post we explore the option within SSMS which allows the DBA and developer to generate scripts for all data and database objects within SQL Server Database.

Right click the database and select Tasks followed up Generate Scripts as shown below:-


Press Next on the below screen

Choose the required option from the below screen

If you only want to generate a script with data from a few selected tables select the radio button “Select specific database objects” and then check the box for tables and select the tables from which you want to generate the insert scripts. As shown below

Set the path to which you want to place the script file under the file name property and click Advanced.

Under the advanced properties select the dropdown under types of data to script and then choose “Data only”, “Schema Only” or “Schema and data” as required.

Press OK and next to move onto the next screen.

Here you can see a summary of the options selected by you after which press Next.

On completion press Finish.