Reputation: 3350
I need to import a database into a SQL Server instance using a batch script and the database is provided by an sql file.
How can I do This?
The SQL file was generated by the SQL Server management studio.
Upvotes: 0
Views: 3111
Reputation: 7986
SQL Server has a command line utility called SQLCMD. It will let you do things like run scripts or restore a database backup. The -i parameter allows you to specify an input file.
There is also an article here that has a quick intro to SQLCMD.
Upvotes: 1