Solved

SQL Server not response SELECT

Posted on 2004-10-19
3
198 Views
Last Modified: 2012-06-21
Hello Experts, I want to verify data in a table that has a few rows, but when I try it with a simple select sentence, SQL Server  not response me. Is the table locked ? What sentence will I use for know what tables are locked???
0
Comment
Question by:karencita78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 69

Accepted Solution

by:
Scott Pletcher earned 50 total points
ID: 12352575
Cancel that SELECT and from QA try this:


SELECT ...
FROM tableName WITH (NOLOCK)
WHERE ...
...


If that works, then the table was locked.  You can use this to find locks:


EXEC sp_lock2  --if it works
EXEC sp_lock  --if sp_lock2 doesn't work

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question