I copy the schema and data of a database into a script, and then I create a new database to execute the script, but I am prompted with the following error:
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, you can Baidu how to check the installation location of the installed database)
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
The server address can be written. Easy to write (local) or IP address
Note The parameter case and the space symbol.
SQL SERVER 2008R2 "Out of memory" solution when executing a large script file