Monday, September 10, 2012

Create DB Script and Restore DB using SqlCmd Utility and .sql file

How to Restore DB from Script:
If you have got db script with data in .sql file then no need to worry. You can run your SQL script with out opening it using SqlCmd utility as follows.


sqlcmd -S servername\instancename -i C:\abc.sql


How to create DB Script:
RightClick DB -->Generate Scripts



Here you go. This way you can create DB script with data included.

No comments:

Post a Comment