Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 What is TabLockX...

Author  Topic 

bbondi
Starting Member

20 Posts

Posted - 2005-04-27 : 11:53:48
Hi all,
The code in question looks like:
Select * from CommGenLock(TabLockX) where 1=2

I'd like to know what it is, does, or references.

The where 1=2 is going to always fail (I venture timidly) so the select returns no rows?


SQL is starting to make sense then something like this pops up

Do the Social Engineering teams need QA? Naw, let 'em have fun!

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-04-27 : 15:21:51
What did you find in Books Online when you looked up the keyword TABLOCKX?

As to the "1=2" thingy...

Was this part of an INSERT ... SELECT... statement?

If so, this is a technique to create a temporary table that has the same schema as the selected table. The 1=2 causes the table to be created but no data to be loaded into it.

You can also look up Temporary Tables in Books Online (BOL).

HTH

=================================================================
Every act of conscious learning requires the willingness to suffer an injury to one's self-esteem. That is why young children, before they are aware of their own self-importance, learn so easily; and why older persons, especially if vain or important, cannot learn at all. -Thomas Szasz, author, professor of psychiatry (1920- )
Go to Top of Page

bbondi
Starting Member

20 Posts

Posted - 2005-04-27 : 15:55:47
Hi,

I'm not sure where the closest BOL is to me, or even what you mean :(

But the explaination about the where 1=2 is really unexpected, thanks for your time.


Bob

Do the Social Engineering teams need QA? Naw, let 'em have fun!
Go to Top of Page

bbondi
Starting Member

20 Posts

Posted - 2005-04-27 : 16:01:52
Hi again,

So Google helped me find the BOL at MS, thanks. Yes the snippet was from a locking section in an SP. Now, I feel like a member of the exclusiveBOL readers.

Do the Social Engineering teams need QA? Naw, let 'em have fun!
Go to Top of Page
   

- Advertisement -