Update SQL Server table 
Author Message
 Update SQL Server table

I am using an SQL update statement in VB 6.0 to update a SQL Server 7.0
table and I keep getting a timeout error.  There are about 600,000 records
in the table and I am using a lookup with two fields which will retrieve the
one and only record that needs to be updated.

Code:

ls_sql_cmd = "update verify_data set input_value = '" & tresult & "' where
verifyid = " & tverifyid & " and fieldid = 1"
cn.execute (ls_sql_cmd)

Does anyone have any ideas why I keep recieving a timeout error?

Please help, thanks

Brent Burkart



Sat, 01 Feb 2003 03:00:00 GMT  
 Update SQL Server table

I can think of a couple, both related to the size of the tempdb in SQL
server and one related to what you are attempting.  First of all I don't see
the tablename in your statement.  Is there a reason for this?

Have you tried running a query in query analyser for the select part of the
statment - something like the following:

select * from x where
 verifyid =   tverifyid and fieldid = 1

If this statement executes quickly there, then the problem has to do with
your cursor type or other connection attributes.

Hope that helps....

Philip Meeks
ETVTechnologies



Sat, 01 Feb 2003 03:00:00 GMT  
 Update SQL Server table
I CAN see the table you are trying to use. It might be worth identifying
where the problem is. In the code, break on the line and interigate
ls_sql_cmd. Lets say you get

update verify_data set input_value = 'MyValue' where verifyid = 2 and
fieldid = 1

Now cut and paste it into Query Analyzer (SQL 7's equivalent to ISQL/w)
How long does it take compared to the VB code's timeout property?

Within Query Analyzer is a menu option to enable some performance stats /
execution plan. Run the query again and see what it suggests in terms of
optimization.

Just my 2€'s worth

Quote:

>I am using an SQL update statement in VB 6.0 to update a SQL Server 7.0
>table and I keep getting a timeout error.  There are about 600,000 records
>in the table and I am using a lookup with two fields which will retrieve
the
>one and only record that needs to be updated.

>Code:

>ls_sql_cmd = "update verify_data set input_value = '" & tresult & "' where
>verifyid = " & tverifyid & " and fieldid = 1"
>cn.execute (ls_sql_cmd)

>Does anyone have any ideas why I keep recieving a timeout error?

>Please help, thanks

>Brent Burkart




Sun, 02 Feb 2003 03:00:00 GMT  
 Update SQL Server table
I can run the query easily in the Query Analyzer, so my guess is it has to
do with the connection to the database.  The problem is I am able to run
other SQL statements using the same connection.  However, when I try and
update that specific table (which is fairly large) I run into problems.


Quote:
> I can think of a couple, both related to the size of the tempdb in SQL
> server and one related to what you are attempting.  First of all I don't
see
> the tablename in your statement.  Is there a reason for this?

> Have you tried running a query in query analyser for the select part of
the
> statment - something like the following:

> select * from x where
>  verifyid =   tverifyid and fieldid = 1

> If this statement executes quickly there, then the problem has to do with
> your cursor type or other connection attributes.

> Hope that helps....

> Philip Meeks
> ETVTechnologies



Mon, 03 Feb 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help me: Update SQL Server table through sqlDataAdapter...

2. Updating A SQL server table through DAO and ODBC In Access 2000

3. Updating attached SQL Server Tables

4. Acc2000: Access tables attached to SQL-Server won't update

5. Simple update to a row in a table in a SQL Server database

6. SQL Server table update

7. Simple update to a row in a table in an SQL Server database

8. sql server table displaying and updating from a datagrid

9. Opening a SQL Server Table from a VB form for update

10. ADO, SQL Server Updating Recordset using 2 Tables

11. Dataset changes updates grid , How to update SQL table

12. 2nd SQL Server update after update text field corrupts row - using RDO

 

 
Powered by phpBB® Forum Software