Reputation: 3
While I am generating script of a database, only the tables and stored procedures are scripted. But I also want the data also. I am using SQL Server 2008. Is there any provision to script with data in a single file?
Upvotes: 0
Views: 259
Reputation: 4842
You can always write your own if it is not too much effort. You can even automate some of it using excel etc. To do this, try:
SELECT 'INSERT INTO sometable (field1, field2, field3)
VALUES (''' + field1 + ''', ''' + field2 + ''', ''' + field3 + ''');'
AS insrow FROM sometable
Upvotes: 0
Reputation: 816
set the script data option to true in the "Choose Script option wizard"
You can also refer to
Upvotes: 1