Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

how to check sql statement excuted

3 posts in General Discussion Last posting was on 2011-12-21 13:10:31.0Z
tom-tom Posted on 2011-12-21 09:13:52.0Z
Sender: 5a4.4ef1a176.1804289383@sybase.com
From: tom-tom
Newsgroups: sybase.public.ase.general
Subject: how to check sql statement excuted
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4ef1a350.618.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 21 Dec 2011 01:13:52 -0800
X-Trace: forums-1-dub 1324458832 172.20.134.41 (21 Dec 2011 01:13:52 -0800)
X-Original-Trace: 21 Dec 2011 01:13:52 -0800, 172.20.134.41
Lines: 7
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30778
Article PK: 73672

Hi,

After running sp_who, I noticed one of the spid is consuming
so much resources. Is there a way the to know the sql
statement executed by the said spid? Thank you.

tom-tom


Mark Posted on 2011-12-21 12:51:28.0Z
From: Mark <mlibner@yahoo.com>
Reply-To: mlibner@yahoo.com
Organization: Security Finance
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: how to check sql statement excuted
References: <4ef1a350.618.1681692777@sybase.com>
In-Reply-To: <4ef1a350.618.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4ef1d650$1@forums-1-dub>
Date: 21 Dec 2011 04:51:28 -0800
X-Trace: forums-1-dub 1324471888 10.22.241.152 (21 Dec 2011 04:51:28 -0800)
X-Original-Trace: 21 Dec 2011 04:51:28 -0800, vip152.sybase.com
Lines: 16
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30779
Article PK: 73669

Maybe you can try one of these commands...

dbcc sqltext [spid]
sp_showplan [spid]

hth,
Mark

On 12/21/2011 4:13 AM, tom-tom wrote:
> Hi,
>
> After running sp_who, I noticed one of the spid is consuming
> so much resources. Is there a way the to know the sql
> statement executed by the said spid? Thank you.
>
> tom-tom


"Mark A. Parsons" <iron_horse Posted on 2011-12-21 13:10:31.0Z
From: "Mark A. Parsons" <iron_horse@no_spamola.compuserve.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: how to check sql statement excuted
References: <4ef1a350.618.1681692777@sybase.com>
In-Reply-To: <4ef1a350.618.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4ef1dac7@forums-1-dub>
Date: 21 Dec 2011 05:10:31 -0800
X-Trace: forums-1-dub 1324473031 10.22.241.152 (21 Dec 2011 05:10:31 -0800)
X-Original-Trace: 21 Dec 2011 05:10:31 -0800, vip152.sybase.com
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30780
Article PK: 73673

If you have MDA tables installed and configured you can pull the SQL text for *currently* running queries from
master..monProcessSQLText.

If you find that monProcessSQLText doesn't display the entire query, take a look at your setting for 'max SQL text
monitored'; you'll probably need to increase this setting to allow more SQL text to be captured/displayed.

On 12/21/2011 04:13, tom-tom wrote:
> Hi,
>
> After running sp_who, I noticed one of the spid is consuming
> so much resources. Is there a way the to know the sql
> statement executed by the said spid? Thank you.
>
> tom-tom