mysqldump equivalent in SQL Server


This is frustrating for a mysql user to take a database dump when they try to do the same in sql server. Here is the one of the optimal way for a mysql user working for sql server.

Right Click on database -> Tasks -> Generate Scripts..
Next -> Select the database name from a list
Under advanced scripting option-> Types of data to Script
You have 3 options to be selected here

  1. Schema only
  2. Data only
  3. Schema and data

sqldump
Later on give the path and file name for generating the script.

Now question is how to run this script?

Two ways:
1. run the below command at DOS command prompt

OSQL -U <userName> -P <password> -S <serverName> -i  <completepathSQLFile>

OR
2. Open the generated script file in a query window and just run them in one go. Just like you run a simple query. But you are advised to do provided its a small sized file.

3 comments on “mysqldump equivalent in SQL Server

  1. Astrid says:

    Wow, marvelous blog structure! How lengthy have you been blogging
    for? you made running a blog glance easy. The full look of your web site is fantastic, as neatly as the content material!

  2. Lorenza says:

    This page really has all of the information and facts I wanted concerning this subject and didn’t know who to
    ask.

  3. Chloe says:

    I do accept as true with all the ideas you’ve presented in your
    post. They’re very convincing and will certainly work.

    Still, the posts are very quick for newbies. Could you
    please extend them a bit from subsequent time?
    Thanks for the post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s