XSolvo
Current user:   guest    Change     Preferences 
   List directory   History   Similar   Print version 
XSolvo 
   About XSolvo 
Articles 
html2xml 
tradufix 
TVProgramGrabber 
download 
Philosophy 
gallery 

Articles > OPENQUERY

 
rw-rw-r--   stga   wheel

OPENQUERY

See LOCALSERVER article for how to setup a linked server to the local server.

SELECT * 
FROM OPENQUERY(LOCALSERVER, 'EXEC sp_who')
WHERE status = 'runnable'

A sample on how you easy can query the stored procedure sp_lock.

SELECT object_name(objid) as objName,
db_name(dbid) as dbName,
--suser_sname() as spidUserName,
SUSER_SID(spid),
*
FROM OPENQUERY(LOCALSERVER, 'EXEC sp_lock')
where object_name(objid) = 'Owner'


Reference OPENQUERY
http://www.xsolvo.com/Articles/OPENQUERY


Prev. Transaction chunks   LOCALSERVER Next