Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Monday, February 20, 2012

locks with select

Hey I have a terrible problem !!

I have a query, and It doesn't matter if it has finished, the table is still locked. Is there any clause to unlock the share mod lock (force) when the query has finished or any way to ensure that table has no locks to continue with another query or transaction ?

Could you give me any sentence ?

Thanks you !!Also, see if there are any open transactions in your database, or in tempdb if your query references temporary objects:
DBCC OPENTRAN('<your_database>')|||Is there any way to turn the data base in optimistic mode, or to execute that in optimistic mode ?|||Yes (http://www.dbforums.com/showpost.php?p=3690898&postcount=13).

-PatP|||Well, but I have a concurrency problem: Update sentence has been thrown while a select is being executed (of the same table), so the select is locking the update, and the query takes a lot of time, what I want to do, is to execute the query and not to wait a long time to be able to execute the update sentence, guaranteeing that I won't have many transactions stuck, and guaranteeing the resulset (of the query) won't have uncommited data.

Any Suggestion ?

Locks the tables while running Report...Very Very Urgent....

Hi all ,

When i Run the report in reporting services, it locks the tables.
so is there any option to Unlock the tables. I m using just select query to run the report but when i run the report it locks the tables.

I used with(nolock) option in select query but it didnt work...still showing me lock on the tables.

Pls help...its urgent

Thanking You,
Rupali Rane.

If this is SQL server you could try changing the query to a stored procedure and putting "set transaction isolation level read uncommitted" in the beginning of the procedure.

|||

"set transaction isolation level read uncommitted" is the equivelant of specifying (NOLOCK) on all tables.

rupamp- Where are you seeing the locks, what type of locks, and do you have a (NOLOCK) on all tables, even in subqueries/derived tables?

As stated above, if you specify "set transaction isolation level read uncommitted" at the beginning of the query, you can skip the (NOLOCK) in the query.

BobP

Locks in SQL2000

How to lock a Row in SQL2000 so that nobody can select that row.

I applied ROWLOCK, but i am not finding the way.

My query is"SELECT * FROM tablename WITH (ROWLOCK)"

Is this the correct way to write locks.

I would be thankful if u help me

Hi,

Maybe the following link is helpful to you.

Row-Level Locking Using ADO & SQL Server http://support.microsoft.com/kb/252317

Thanks.

|||

Hi all,

I am using SQLServer 2000 & .Net 2003 (1.1 framework)

I had a database calledDATA and the fields ID, Name, Remarks, etc...

I need to give access all the data to my employees in their browser machines.

Number of employees may be from 50 to 150.

If a particular record is fetched by 2 users simultaneously one person is getting an error. For this i need to put locks in the database.

If a particular record is fetched by 1 user, then immediately the another employee who is accessing it, should get another record/data.

Being keeping in mind, how can i solve this scnario?

Any body please help me...

Regards,

Jai Shankar