I have a huge .sql file (1.5 gb). I generated it from scripting a datasbase in Sql server 2008. Now i want to run the script on another machine to create the same database with all the data, but when i try to open it, SSMS throws an out of memory exception. The machine has 8gb of ddr3 ram, so the computer can handle it. How can i run my file, copy.sql, which has the t-sql code to create my database without opening it? Something like this in a query window in SSMS:
exec copy.sql
Have you tried osql.exe or sqlcmd.exe? They probably will handle it better.
Also, you could export the data as bcp which would make it easier to import since it’s so large.