3

I was export the database from SQL Server 2005, which is the format ".bak". I need to convert the .bak file into .sql file format. i.e convert .bak file into SQL statements.

Because, i have a many bak files ( which are exported from various SQL Server versions). So, i need to convert the bak into sql.

Thanks in advance.

Mr. Black
  • 11,692
  • 13
  • 60
  • 85
  • A .bak file is not made up of SQL statements, so this is not possible. What is it that you need to do? Maybe we can suggest an alternative to accomplish your goal. – Michael Fredrickson Mar 29 '11 at 05:39

2 Answers2

3

Restore the backup and then script it out to SQL statement with something like SQL publishing wizard.

My Other Me
  • 5,007
  • 6
  • 41
  • 48
  • If you don't want to/can't do a full restore look into something like Red Gate's SQL Virtual Restore: http://www.red-gate.com/products/dba/sql-virtual-restore/ (I have not tried this myself yet, but generally Red Gate does what it says on the box.) – My Other Me Mar 29 '11 at 05:57
  • 1
    thanks my-other-me. any other way to extract the bak file content. i.e i need a simple tool/script to extract/convert the bak file into sql. Why i'm ask this?. I don't like to install the sql server. Just simply convert the bak file into sql – Mr. Black Mar 29 '11 at 06:22
0

restore database from .bak file. refer following link where generate script into sql file Get .sql file from SQL Server 2012 database

Community
  • 1
  • 1
Vishe
  • 3,383
  • 1
  • 24
  • 23