0

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?

1
  • You mean you are trying to extract data from an existing database or you want to be able to put data in a database on deployment? Commented Feb 8, 2013 at 10:26

3 Answers 3

1

set the script data option to true in the "Choose Script option wizard"

You can also refer to

http://blog.sqlauthority.com/2009/07/29/sql-server-2008-copy-database-with-data-generate-t-sql-for-inserting-data-from-one-table-to-another-table/

Sign up to request clarification or add additional context in comments.

Comments

0

APEXSQL have a tool that will allow you to script your entire DB with data...

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.