How to export your tables and all of the content into a T-SQL file from SQL Server

Export database and all its contents into a TSQL file

The SQL Database publishing wizard is a great tool for exporting out your sql database tables, all its content and any stored procedures that you have into a T-SQL file. No more fiddling with text files or excel sheets.

Simply download the tool from Microsoft here and follow the on-screen instructions to install. The install will put a new program in your 'All Program Files' list called 'Microsoft SQL Server Database Publishing Wizard'. Click on the application and a really simply wizard will open up. You should see something like this:

use SQL Publishing Wizard to export SQL and all its contents into a TSQL file

Enter your server name or pc name to connect to the sql server databases on your machine and go to the next screen. The wizard should present you with a list of all of your sql databases. Highlight the one you want to export and make sure you tick the 'Script all objects in the database' option in the bottom corner.

use SQL Publishing Wizard to export SQL and all its contents into a TSQL file

After the above screen you pick where to create the .sql file and click next next next (etc) until the wizard is done. Once completed you will have one .sql file containing all of your tables, stored procedures, etc in a T-SQL file.

SQL
blog comments powered by Disqus

Get In Touch

Follow me online at TwitterFacebook or Flickr.

Latest Tweets