Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_lock command

Status
Not open for further replies.

somnath74

Technical User
Mar 5, 2002
24
IN
Hi ,
I have come across a very interesting situation and I need some light on it.While using the sp_lock command in the production database I do not get the column table_name in the output .However when it is used in the replication server I am get to see the table_name column.
Can someone please let me know how this can be possible or is it a Sybase Rep server feature?

Thanks in advance

Somnath
 
hello,

if you go to the sybsystemprocs database and do a sp_helptext sp_lock you will find that the sp is selecting on the id for the table...

the following is an excerpt of sp_lock on 11.9.2:

if @spid1 is not NULL
begin
select @length = max(datalength(db_name(dbid)))
from master..syslocks
where spid in (@spid1, @spid2)

if (@length > 15)

select fid, spid, locktype = v1.name, table_id = id, page, row,
dbname = db_name(dbid), class, context=v2.name
from master..syslocks l, master..spt_values v1, master..spt_values v2
where l.type = v1.number
and v1.type = "L"
and (l.context+2049) = v2.number
and v2.type = "L2"
and spid in (@spid1, @spid2)
else
select fid, spid, locktype = v1.name, table_id = id, page, row,
dbname = convert(char(15), db_name(dbid)), class,context=v2.name
from master..syslocks l, master..spt_values v1, master..spt_values v2
where l.type = v1.number
and v1.type = "L"
and (l.context+2049) = v2.number
and v2.type = "L2"
and spid in (@spid1, @spid2)
end

now do the same thing with your replication server and compare...

hth,
q.

 
Thanks a lot for the response.The sp_lock in the rep server is really different

Best Regards

Somnath
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top