Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Using below command you import the data to sql table, using command prompt we can.

sqlcmd -S server\MYSQLSERVER -d demo -U Test -P test234 -i C:\Users\rja\Desktop\Ra\dbo.WebBP.sql

Its working fine.

If *.sql file size is more than 3 GB. It takes time to insert more than half a day.

But, I need to insert immediately.

Please anyone help me.

What I have tried:

I tried import data in sql server. But that is not working.
Posted
Updated 26-Jul-16 4:31am
Comments
Richard Deeming 26-Jul-16 9:29am    
You might be able to improve the performance by changing the query in your .sql file, or by tweaking the indexes on your database.

But I doubt you'll ever be able to load and insert a 3GB file instantly. Just reading that much data into memory and then transferring it over the network to SQL is going to take a noticeable amount of time.
Afzaal Ahmad Zeeshan 26-Jul-16 9:49am    
Do what Richard has said, or buy a powerful computer.
Dave Kreskowiak 26-Jul-16 10:26am    
What's in the .SQL file? Where did this file come from? Do you have control over its generation?

If it's just a bunch of INSERT statements, you could possibly scrap that and use SSIS to Bulk Insert the data.

There is no way on earth you're ever going to get an "instant" insert of that much data.

1 solution

Assuming the bottle neck is network transfert during base appending.
You can use a 2 steps method.
1) create an 'import' base with right structure on server.
2) copy your data from client to 'import base on server.
3) append the 'import' base to real base (the data is already local)
4) delete 'import' base
This avoid the slow network transfert during appending to database.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900