- Open Visual Studio
- Open "View" → "SQL Server Object Explorer"
- Add a connection to your Server
- Expand the relevant database
- Expand the "Tables" folder
- Right click on relevant table
- Select "View Data" from context menu
- In the new window, viewing the data use the "Sort and filter dataset" functionality in the tool bar to apply your filter. Note that this functionality is limited and you can't write explicit SQL queries.
- After you have applied your filter and see only the data you want, click on "Script" or "Script to file" in the tool bar
- Voilà - Here you have your insert script for your filtered data
Notes:
- Be careful, the "View Data" window is just like SSMS "Edit Top 200 Rows": you can edit data right away!
- Remember to add SET DATEFORMAT YMD before the INSERT command.
Via https://stackoverflow.com/a/51186767/14507440