How to lock sql server table?
Posted: Mon Apr 26, 2010 6:21 am
Hi,
Basically we need to insert data into sql server table with lock enable so that no sidu operation is allowed for other users.
I have tried having isolation level to serializable, using hint as TABLOCKX but when the job is under execution in DataStage, I am able to select records from front end client.
I have tried this with ODBC and DRS stages but result not as expected. I am able to select records in another session which should not happen until DS job completes.
Is there any way to do this (ie. need to lock the table exclusively and do the insert in DataStage job)?
Thanks in advance.
Basically we need to insert data into sql server table with lock enable so that no sidu operation is allowed for other users.
I have tried having isolation level to serializable, using hint as TABLOCKX but when the job is under execution in DataStage, I am able to select records from front end client.
I have tried this with ODBC and DRS stages but result not as expected. I am able to select records in another session which should not happen until DS job completes.
Is there any way to do this (ie. need to lock the table exclusively and do the insert in DataStage job)?
Thanks in advance.