How can I get a SQL dump of a SQL Server 2008 database? That is, a .sql file with inserts to regenerate the data in another database, much like mysqldump.
相关问题
- SQL to Parse a Key-Value String
- How to evaluate an input in the WHERE clause
- Analyzing Outlook HANG dump (with GoogleCalendarSy
- employee id automatic generate with prefix
- update user details, sql server 2008 sqlsrv
相关文章
- Code for inserting data into SQL Server database u
- SQL Server 2008 Change Data Capture, who made the
- How do we alias a Sql Server instance name used in
- How to do a UNION on a single table?
- SQL Group by Count of Counts
- SQL Server drop and recreate indexes of a table
- How to generate sequential row number in tsql?
- Pass table as parameter to SQLCLR TV-UDF
Not finding what I needed (scriptable tool dumping SQL statements), I have created a tool called SQL Server Dump which is inspired by mysqldump, but for SQL Server. You will find it at sqlserverdump.codeplex.com
From SQL Server Management Studio you can use the Generate Scripts command in the Tasks item of the right-click menu on the target database. From here you generate scripts for the structure and data and SPs etc: make sure 'Script Data' is set to True in the scripting options to get the inserts.
I had a hard time finding the 'Script Data' option mentioned in stuartd's answer on SQL Server 2008 R2. I found the 'Types of data to script' option and changed it to 'Schema and Data' and that did the trick