If I have a table with data in a database in SQL Server, how can I generate a script that will create the table and add the data too?
If I right click on the table then select Script Table As > Create to > File
, that generates a script to just create the table without the data. What I need is a script that creates the table and adds the data that is already existing in the table or 2 separate scripts, one that creates the table and one that adds the data.
Right click on the DB_NAME -> Select Task -> Select Generate Script. Follow along the presented wizard and select all tables in that database to generate the scripts.
Here what you have to do:
Use SSMS scripting feature (Rightclick on database->Tasks->Generate Scripts)
or
use SSMS Tools Pack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With