Script SQL Insert Statement from Data
Using SQL Server Management Studio ( SSMS), I entered quite a bit of data into a new table.
Not wanting to ever repeat that arduous process, I sought out tools that will allow me to script out the data.
Yes, BCP will work, but I will be scripting out the data and will not be getting the SQL Statements.
Download and Install
Downloaded and Installed DBeaver.
BTW, here is the link.
Installed Microsoft SQL Server JDBC Driver
Using built-in tooling added Microsoft’s SQL Server JDBC Driver.
In DBeaver, launched new “SQL Editor”.
Entered the Query:
SELECT RoleID, RoleName FROM dbo.listofServerRoles tblSR
To capture the SQL, select all the records you will like scripted.
Then choose the menu items, “Generate SQL” and “Insert”.
There are some shortcomings in DBeaver’s implementation.
I will cover the shortcomings and workarounds in a later post.