Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL 2000 sp_prepare and sp_execute

Posted on 2006-07-06
3
Medium Priority
?
1,728 Views
Last Modified: 2012-06-22
Does anyone know if you can view all the sp_prepare statements and their handler numbers, or view them by a handler number in SQL using either query analyzer or Enterprise Manager?

There are a lot of sp_execute commands being run, and I need to see the prepare statements.  Using profiler is only showing me the execute statements.

Thanks.
0
Comment
Question by:TheTull
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1500 total points
ID: 17052048
You can do this

Run

SELECT * from master..sysprocesses

find the handle associated with the processid

and pass this processId

SELECT * from ::fn_get_sql(0x0100070017FF762CC040891A0000000000000000)
0
 
LVL 7

Author Comment

by:TheTull
ID: 17052677
If I understand you correctly, you mean get the SPID of the sp_execute process, then find the sql_handle and use that number in the second select statement you gave me?

If that's the case, then the sql_handle I get from the sysprocesses table is all 0s, so I don't know if I am misunderstanding you or not,

thanks for the help too.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17166178
>you mean get the SPID of the sp_execute process
NO, Both SPID and SID are different

Select sid, SPID from master..sysprocesses
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
What we learned in Webroot's webinar on multi-vector protection.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question