Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record locking within an SQL stored procedure
Message
From
29/12/2005 14:16:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Record locking within an SQL stored procedure
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01081764
Message ID:
01081764
Views:
67
Hi

I'd like to be able to perform record locking, row update, within SQL2000. Basically, I'm trying to do the following:

1. Select the correct record
2. Attempt to lock record
3. If able to lock, update a field within that record, release lock
4. If not able to lock, attempt to lock for a specified amount of time.

Here are some questions:

1. If I attempt to lock the record with the select, what happens if the record is already locked or I'm unable to complete the lock? i.e. I'd want to be able to return a code to the calling program why the SQL procedure couldn't lock the record.

Basically, it's as simple as that but it I've found it hard work reading the on-line SQL help files. The record locking MUST be completed by SQL server as the procedure will be called from VFP, VB and various other technologies.

Regards
Next
Reply
Map
View

Click here to load this message in the networking platform