tablaFreak
asked on
SQL Server Hanging on Bulk Inserts
Hello Experts,
When trying to run a script from Generate Scripts copying data from one database to another, using the 'Check for object existence = True', 'Script Drop and Create', and 'Copy Schema and Data', the query is just hanging indefinitely. Any idea what might be causing that?
Thanks,
Steve
When trying to run a script from Generate Scripts copying data from one database to another, using the 'Check for object existence = True', 'Script Drop and Create', and 'Copy Schema and Data', the query is just hanging indefinitely. Any idea what might be causing that?
Thanks,
Steve
Another thing would be to start with a higher initial data file size. Because I/O is the slowest component, every time the SQL Server goes to expand the data file and the log files, it will take a considerably long time.
ASKER
Thanks guys, I appreciate the input. Turns out when I used the command line with "SQLCMD -d <database-name> -i filename.sql" the script ran with no problemo. Cheers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There should be some indication of what's occurring.
Also, check CPU time accumulating on the script you're running. So long at CPU continues to accumulate, some processing is still occurring.
If CPU time is still accumulating on your script, then just let it run.
One trick you can use with large database loads is to create your target table(s) with no indexes. Then after load finishes, create indexes. Sometimes this dramatically speeds up data loads.