When MS SQL executes a large script file, it prompts the "failed to complete operation, insufficient storage space to handle this command" workaround

Source: Internet
Author: User
Tags microsoft sql server management studio microsoft sql server management studio sql server management sql server management studio

Problem Description:

When a client server does not allow direct backup, it is often deployed by exporting database scripts-restoring the database,

However, when the database export script is large, when you execute a script with Microsoft SQL Server Management Studio, you often experience "out of memory" prompts.

Workaround:

With Microsoft's own sqlcmd tool, you can import execution. Take the SQL Server 2008R version as an example:

First step: Win+r type:cmd command, open command line tool;

Step two: Type:cd C:\Program Files\Microsoft SQL Server\100\tools\binn (the specific directory path is related to the SQL location you installed)

Step three: Type:sqlcmd-s.-u sa-p 123-d test-i data.sql

Parameter description:-S server address- u user name- p password - D database name-I script file path

(It is recommended to copy the data script file to this directory, just write the file name instead of the full path), note the parameter case and the space symbol.

When MS SQL executes a large script file, it prompts the "failed to complete operation, insufficient storage space to handle this command" workaround

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.