Fix an issue where SQL script files are too large to open

Source: Internet
Author: User

As we known,sql database high version to low version restore is unlikely but often encountered, today measured a method

Step: Task-"Generate script-"

Next-Advanced, select the database version and script the data type as schema and data, you can preserve the data.

Proceed to the next step to complete.

Eventually get a huge SQL script file

-The next step is to create a new target database in the lower version of the database and then run the SQL script file to

General SQL file we are directly executed in the query window of SQL Server, but this huge SQL file is too big, SQL Server or even Notepad can not open ...

So I have the following command.

Sqlcmd-s. \sql2008-u sa-p sql2008-d backamsdata_nd-r-I C:\Users\LYD\Documents\script.sql

After the execution of the command is a long wait, after all, 1.5 g files ...

Note that if the script is too large, you can close the STDERR message (without adding the-R parameter) to speed up execution.

。。。。 Friendship tip: So the data speed is very slow and slow, it is best to try to eliminate garbage data, reduce the amount of data ... In this way, there is no need for this method ........ .....

Take someone else's picture to illustrate

The command parameters for SQLCMD are as follows:

1 [-u login ID] [-p password]
2 [-s server] [-h host name] [-E Trusted Connection]
3 [-D using Database name] [-L login timeout] [-t query timeout value]
4 [-H title] [-S column delimiter] [-w width]
5 [-A packet size] [-e echo input] [-I allow quoted identifiers]
6 [-l list Server] [-C command end] [-D ODBC DSN name]
7 [-Q "Command-line Query"] [-Q "Command-line Query" and exit]
8 [-N Delete Numbering method] [-m error level]
9 [-R message sent to stderr] [-V severity level]
Ten [-I input file] [-o output FILE]
[-P print statistics] [-B Abort batch On ERROR]
[-x[1] Disable the command, [exit with warning displayed]]
[-O use old ISQL behavior to disable the following items]
<EOF> Batch Processing
15 automatic adjustment of the console width
16 Wide Message
17 Default Error level is-1 and 1

Https://www.cnblogs.com/lyd2016/p/6491284.html?utm_source=itdadao&utm_medium=referral

Troubleshoot problems with SQL script files that are too large to open

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.