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 2005 Forums
 SQL Server Administration (2005)
 How to convert sp_who in a table/query.

Author  Topic 

krajdba
Starting Member

43 Posts

Posted - 2007-09-12 : 07:29:24
Hi

How to convert a sp_who in into a table/query

Please help



Raj.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-12 : 07:33:55
[code]SELECT *
INTO #Temp
FROM OPENROWSET('SQLNCLI', 'Server=(local);Trusted_Connection=yes;', 'EXEC sp_who')

select * from #temp[/code]


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2007-09-12 : 09:17:03
create temp #table with exact definition for the sp resultset

insert into #table
exec sp_who


--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -