Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to backup Sql Server to sql file?

Tags:

In "Back UP" I only get a bak file, but I would like to create .sql file

like image 606
IAdapter Avatar asked Mar 06 '11 18:03

IAdapter


People also ask

How do I create a backup script in SQL Server?

To do a full database backup to File/Query you can use the 'Generate Scripts...' option on the Database. Open SQL Server Management studio, right click on the database and choose 'Tasks->Generate Scripts...' Then use the wizard to backup the database. You can script the whole database or parts of it.


1 Answers

Use SQL Server's Generate Scripts commend

  • right click on the database; Tasks -> Generate Scripts
  • select your tables, click Next
  • click the Advanced button
  • find Types of data to script - choose Schema and Data.
  • you can then choose to save to file, or put in new query window.
  • results in CREATE and INSERT statements for all table data selected in bullet 2.

SQL Server Generate Scripts Data

like image 91
p.campbell Avatar answered Sep 24 '22 05:09

p.campbell