HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Executing a very large SQL file

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
executingfilesqllargevery

Problem

I have a 830mb .sql file which is a scripted DB.

I wish to execute this SQL so it will create and insert data into a database on a hosted server. I cannot get it to open in SQL Server Management Studio or EMS SQL Manager.

How can I execute it?

Solution

Depends on db flavor, most provide command line tools to load sql files. Looks like you may be using ms sql, reference here http://technet.microsoft.com/en-us/library/ms165702(v=sql.105).aspx, more specific http://technet.microsoft.com/en-us/library/ms170572.aspx

sqlcmd -S myServer\instanceName -i C:\myScript.sql

Code Snippets

sqlcmd -S myServer\instanceName -i C:\myScript.sql

Context

StackExchange Database Administrators Q#54453, answer score: 9

Revisions (0)

No revisions yet.