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?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
Take a look at  your server logs + see if you've hit some resource limit.

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.
Nakul VachhrajaniTechnical Architect, Capgemini IndiaCommented:
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.
tablaFreakAuthor Commented:
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.
tablaFreakAuthor Commented:
SQLCMD -d <database-name> -i filename.sql

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.