Generate scripts: Microsoft Learn documentation
Simple Data Scripter source: Github project
It is commonly useful when you want to generate a simple insert script from the resultset that you generated using a table content, a view, or a complex query. There are 2 quick methods:
- Log in to the destination db in SSMS.
- Right-click on database name in Object Explorer window. Select Generate Scripts… option.
- In the wizard click Next
- After loading the database objects list pick a selected table name. Click Next
. - On Scripting Options window choose the destination where your generated script will land. Then, go to Advanced.
- In Advanced window, among plenty of options, choose “Type of data to script” as Data only. You can consider also other scripting options if needed.
- Hit OK and Next. The generation takes couple of seconds, depending on a number of files and rows to script.
- Open Azure Data Studio, navigate to Extensions tab on the left and look for Simple Data Scripter. Install it (it may redirect you to github page).
- Once downloaded, install it from external source (the file downloaded in step 1.)
. - After the installation log in to the database, find your desired table or view to be scripted, right-click on its name and choose Script Table Data. In fact it can be any table in the system – the dialogue box will let us change the script.