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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Best Practice for table update from VB

Author  Topic 

type9
Starting Member

6 Posts

Posted - 2004-01-30 : 08:15:01
Hi,

I'm wondering is this workflow the best approach:

Design VB form for data input
Validate data on VB side
Execute Stored proceedure
Send message 'update sucessful!'

Are there any specific checks i should use in the Stored Proc. before new record added or record updated. Assuming table is designed properly with PK etc.

I'm developing an APP for a new client who is very strict on standards.

thanks in advance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-30 : 12:25:58
You should put the UPDATE statement in a transaction if it is going to be multiple statements. After each statement, check the @@ERROR variable for error. If error, ROLLBACK. Otherwise, COMMIT.

The first statement in your stored procedure should be SET NOCOUNT ON.

Tara
Go to Top of Page
   

- Advertisement -