<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: return SP_WHO sybase result in Installing and Upgrading</title>
    <link>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398373#M8923</link>
    <description>denis, 
&lt;BR /&gt;dont' forget that SP_WHO is a stored procedure...
&lt;BR /&gt;it's quite special...
&lt;BR /&gt;see u tomorrow... ( we are working on the same company )</description>
    <pubDate>Wed, 18 Jul 2007 18:21:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-07-18T18:21:18Z</dc:date>
    <item>
      <title>return SP_WHO sybase result</title>
      <link>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398372#M8922</link>
      <description>Hi &lt;BR /&gt;I would like to display the result of SP_WHO into excel file.&lt;BR /&gt;the probleme is when I used a  tSybaseRow no results return&lt;BR /&gt;&lt;BR /&gt;SP_WHO is de default sybas e fonction return information about DB &lt;BR /&gt;Do you have any lead to resolved my issues&lt;BR /&gt;DN</description>
      <pubDate>Sat, 16 Nov 2024 14:34:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398372#M8922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: return SP_WHO sybase result</title>
      <link>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398373#M8923</link>
      <description>denis, 
&lt;BR /&gt;dont' forget that SP_WHO is a stored procedure...
&lt;BR /&gt;it's quite special...
&lt;BR /&gt;see u tomorrow... ( we are working on the same company )</description>
      <pubDate>Wed, 18 Jul 2007 18:21:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398373#M8923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-07-18T18:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: return SP_WHO sybase result</title>
      <link>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398374#M8924</link>
      <description>1) SP_WHO is not "about DB" in general, but specifically about _current user sessions_ in the Sybase data server, _whatever the database_. 
&lt;BR /&gt;2) SP_WHO returns *multiple resultsets* in a TDS stream; that's not easy to handle, and I know no ETL tool that could switch dynamically the column list and column format for every new resultset 
&lt;BR /&gt; 
&lt;BR /&gt;If you want a list of current user sessions you can tap directly in the system tables; below a "simple" query that works with ASE 12.5 but has not been tested with 15.x 
&lt;BR /&gt;NB: for sessions that run on another database, you can't get the actual DB user, that would require dynamic sub-queries and admin privileges. Hence the 'unknown' comment. 
&lt;BR /&gt;select ps.spid, 
&lt;BR /&gt; case when ps.spid =@@spid 
&lt;BR /&gt; then '#current' 
&lt;BR /&gt; when ps.cmd ='AWAITING COMMAND' 
&lt;BR /&gt; then 'idle' 
&lt;BR /&gt; else rtrim(ps.cmd) +' ' +rtrim(ps.status) 
&lt;BR /&gt; end as status, 
&lt;BR /&gt; usr.name as "login", 
&lt;BR /&gt; case when ps.dbid =db_id() 
&lt;BR /&gt; then dbusr.name 
&lt;BR /&gt; else 'unknown' 
&lt;BR /&gt; end + ' @ ' +db.name as "db user", 
&lt;BR /&gt; ps.hostname as "client", 
&lt;BR /&gt; case when charindex(ps.hostname, ps.program_name) =1 
&lt;BR /&gt; then '' 
&lt;BR /&gt; else rtrim(ps.program_name) 
&lt;BR /&gt; end as "program", 
&lt;BR /&gt; ps.tran_name as "transaction", 
&lt;BR /&gt; case when ps.blocked =0 
&lt;BR /&gt; then null 
&lt;BR /&gt; else ps.blocked 
&lt;BR /&gt; end as "blocked by" 
&lt;BR /&gt;from master.dbo.sysprocesses ps 
&lt;BR /&gt;join master.dbo.sysdatabases db 
&lt;BR /&gt; on ps.dbid =db.dbid 
&lt;BR /&gt;join master.dbo.syslogins usr 
&lt;BR /&gt; on ps.suid =usr.suid 
&lt;BR /&gt;left join sysusers dbusr 
&lt;BR /&gt; on ps.uid =dbusr.uid 
&lt;BR /&gt;order by 
&lt;BR /&gt; case when ps.spid =@@spid 
&lt;BR /&gt; then -1000 
&lt;BR /&gt; when ps.dbid =db_id() 
&lt;BR /&gt; then case when ps.tran_name is not null or ps.blocked &amp;gt;0 then 0 
&lt;BR /&gt; when ps.cmd ='AWAITING COMMAND' then 666 
&lt;BR /&gt; else 333 
&lt;BR /&gt; end 
&lt;BR /&gt; +ps.spid 
&lt;BR /&gt; else ps.dbid *1000 
&lt;BR /&gt; +case when ps.tran_name is not null or ps.blocked &amp;gt;0 then 0 
&lt;BR /&gt; when ps.cmd ='AWAITING COMMAND' then 666 
&lt;BR /&gt; else 333 
&lt;BR /&gt; end 
&lt;BR /&gt; +ps.spid 
&lt;BR /&gt; end</description>
      <pubDate>Wed, 18 Jul 2007 18:41:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398374#M8924</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2007-07-18T18:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: return SP_WHO sybase result</title>
      <link>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398375#M8925</link>
      <description>SybaseUnHappyUser 
&lt;BR /&gt;I'm using this query . It's pretty same 
&lt;BR /&gt; 
&lt;BR /&gt;select p.spid, p.status, l.name, p.hostname, p.program_name, p.hostprocess, p.cmd, p.cpu, p.physical_io, p.memusage, p.blocked, db_name(p.dbid) from master.dbo.sysprocesses p, master.dbo.syslogins l where p.suid *= l.suid</description>
      <pubDate>Thu, 19 Jul 2007 12:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Installing-and-Upgrading/return-SP-WHO-sybase-result/m-p/2398375#M8925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-07-19T12:52:25Z</dc:date>
    </item>
  </channel>
</rss>

