?
Solved

SQL 2000 sp_prepare and sp_execute

Posted on 2006-07-06
3
Medium Priority
?
1,715 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this article, we’ll look at how to deploy ProxySQL.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

777 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