for example i have a table
and i update a column
using this query:
set column1='something where column2='otherthing'
i dont give the "commit tran" statement
but when i give a select statement on table1
select column1 from table1
i find the change has been effected eventhough i have not given the commit tran command
Re-run the test you did and leave the transaction uncommitted. However, this time, open up another Query Analyzer windows/session. Do the select again. What happens? You should find that it hangs. That's because there are locks in place. Now go back to the first QA session and commit the transation. Go back to the second QA session and see what happens... The select should complete.
It's interesting that SQL Server puts a table lock on when you might think that a row lock would be sufficient. What do the experts have to say about this?
ya u were rite not able to select on that table in a new query analyser window.
pls crichardson can u explain me in detail more about locks and its use
where it is necessary and where it is redundant
pls dont pick passages from sql help