Often times, we require to generate SQL script of a SQL Server database and its data. The script can be used to backup or restore or copy database. Here are the steps required to generate the script.
Step 1: Log in to your MSSQL Serevr
Step 2: Go to your database and Right Click
Step 3: Task--> Generate Script. It will open a window
Step 4: Click Next-->Check the checkbox-->Next
Step 5: On current window, "Choose script option", go to table/view
operation after scroll down.
Step 6: Change "true" from "false" on script data option.
Step 7: Click on next-->Next-->finish
The generated script has database objects script as well as the data in insert commands.