Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forcing RLOCK() in SQL Server
Message
De
20/11/2005 18:41:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Forcing RLOCK() in SQL Server
Divers
Thread ID:
01070653
Message ID:
01070653
Vues:
57
Is there a way to force a record locking in SQL Server?

I have this code which is returning the next primary key on a specific table and I am trying to know if this code can be converted to achieve the same assuming I have the same data structure on SQL Server.
* Get the next id
* expC1 Name of the table in TABLE.DBF
FUNCTION GetNumero
PARAMETER tcTable
LOCAL lnOldSel,lnCompteur,lnNumero,lnLen,lcTable,lnOldRec
lnOldSel=SELECT()
lnCompteur=0
SELECT TABLE
lnOldRec=SaveRec()
lnLen=LEN(Table)
lcTable=PADR(tcTable,lnLen,' ')
SEEK UPPER(lcTable) ORDER TAG TABLE
DO WHILE (NOT RLOCK()) AND (INKEY(0.1)=0) AND lnCompteur<=25
   lnCompteur=lnCompteur+1
ENDDO
REPLACE ID WITH ID+1
UNLOCK
lnNumero=ID
RestRec(lnOldRec)
SELECT(lnOldSel)
RETURN lnNumero
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform