Importing a large SQL file in Microsoft SQL server 2008

Submitted by Jochus on Wed, 13/03/2013 - 23:17 | Posted in: Database

  • Go to: Start -> Run -> Type cmd and press enter
  • Once the command line is on screen tell SQLCMD to import your database by doing something like this:
    sqlcmd -S [server instance name] -d [database name] -i [filename you want to import]
  • If you're not sure about the server instance name; simply open up SQL Server Management Studio and on the login screen take a note of the Server Name textbox as this is the value you need to use as the server instance name.
  • If you are trying to enter a lot of INSERT statements, don't forget to flush while inserting using the GO command (for example, after each 100 rows).


Submitted by Anonymous (not verified) on Mon, 09/06/2014 - 22:52


Add new comment

The content of this field is kept private and will not be shown publicly.


  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.