Sometimes when we get a large SQL script file (such as hundreds of M), you can choose Sqlcmd if you want to execute it.
1. In the following sentence
C:\>sqlcmd-i test.sql-d databasename-s 127.0.0.1
Note: This Test.sql file is to be placed in the corresponding drive letter (this is put in C drive)
Related parameters
C:\users\administrator>sqlcmd/?
Microsoft (R) SQL Server command-line tools
Version 10.0.1600.22 NT x64
Copyright (c) Microsoft Corporation. All rights reserved.
Usage: Sqlcmd [-u login ID] [-p password]
[-s server] [-H host name] [-E Trusted Connection]
[-D using Database name] [-L login Timeout value] [-t query timeout value]
[-H title] [-S column delimiter] [-w Screen width]
[-A packet size] [-e echo input] [-I allow quoted identifiers]
[-C command end] [-L[C] list servers [clear output]]
[-Q "Command-line query"] [-Q ' command-line query ' and exit]
[-m error level] [-V Severity level] [-W Delete trailing spaces]
[-u Unicode Output] [-R[0|1] message sent to stderr]
[-I input file] [-O Output FILE] [-Z New Password]
[F < code page > | i:< code page >[,o:< code page;]] [-Z New Password and exit]
[-k[1|2] Delete [replace] control characters]
[-y variable length type display width]
[-Y fixed length type display width]
[-p[1] Print statistics [colon format]]
[-R using client locale]
[-B Abort batch On ERROR]
[-V variable = "value" ...] [-A dedicated management connection]
[-x[1] Disable command, startup script, environment variable [and exit]]
[-X disables variable condition]
[-? display syntax summary]
C:\users\administrator>sqlcmd-i D:\SCRIPT. Sql