Here is the procedure for generating scripts in SQL Server.
Step 1
Open SQL Server.
Step 2
Click on database and choose database.
Step 3
Right-click on the database you selected. There will be an option called Task; after clicking it you will see another option called Generate Scripts.
Step 4
Click on Generate Script, you will get another screen where you can customize the options depending on you.
In my scenario, I have only two tables in my database and I want to generate table1 script. So I am selecting the second option and click next.
Step 5
After clicking next you will get the following screen:
Step 6
Click the Advanced button, you will get another screen. Scroll down that screen and you will get a property named “Type of data to script”. By default it is schema only. You can change it depending on your requirements.
In my case I will set “Data only” and say OK.
Step 7
Click Next.
Step 8
Click Next.
Step 9
Click Finish.
I hope you enjoy this article.
Happy coding.