Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Inconsistent data output of INSERT SELECT statemen

Author  Topic 

avalon99
Starting Member

3 Posts

Posted - 2009-04-15 : 23:36:35
Hi,

I'm quite new to a massive network of application accessing a SQL server. We created an application in VB, and used the "Insert into select" statement for bulk transfer to a temporary table. The source table and destination table have the same fields. Our problem occurs when the SQL server lags due to report generation, the "insert into select" statement would be executed but results in blank transfer. On normal times, there are no data lost. Can you guys please help point me to the right direction to help solve this issue.

Thanks a lot.

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2009-04-16 : 07:40:56
Where is this data being "bulk transferred" from? Where is your "Insert into select" being executed from?

Sounds like this could be a job for BCP BULK INSERT, or perhaps a Stored Procedure.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

avalon99
Starting Member

3 Posts

Posted - 2009-04-17 : 06:22:38
Hi,

the data topology looks like this;
PC1 -> Server <- PC2

All data are found in the server. What PC1 did was to upload the bulk data read from an excel to the server through SQL insert.

PC2 is using the same application PC1 is using, but different tables and simply doing a data viewing to a vb form.

What the form was doing is reading from table 1, deleting previous copies to the temporary table and then re-copying it to a temporary table based on the primary key picked (Which brings about the use of "insert into select" statement.)

We did some code modification, by limiting the delete to only after 'form exit' seems to resolve the lag and deadlock.

After we compose our guts to patch the rtm version of the SQL 2000 to SP4, and re-tested the previous code of the application, the problem seems to be fixed by the SP4 patch too.

Thanks for all the help, if you believe there is a probability of our solution being not a permanent solution or if the problem is just masked out, Please email me too.

Thanks DonAtWork
Go to Top of Page
   

- Advertisement -