C,
Syscomments is for code that is persisted in a SQL Server database, such as
a stored procedure, function, view, etc. Prepared statements are not to be
found there.
There is a system table/view available in 2000 and 2005 that may help you in
some cases:
select * from master.dbo.syscacheobjects
This is deprecated in SQL Server 2005, so you should investigate the new
dynamic management views for 2005. This page from the BOL has a link to a
discussion of the new views that you should be using:
http://msdn2.microsoft.com/en-us/library/ms187815.aspx
RLF
<codefragment@googlemail.com> wrote in message
news:bd4ad615-e8fa-453f-b72f-bfee5d874e25@a23g2000hsc.googlegroups.com...
> (apologies for the cross posting but 5 days with no joy in other
> newsgroup)
>
> Hi
> I'm sure lots of people have asked this before, but I can't find
> any
> threads so:
>
> Assuming you haven't had your profiler open for long enough is there
> any way of getting to the procedure
> code that was prepared with sp_prepexec in query analyser?
> If not why not? (I'm sure theres a good reason but I'd like to
> know)
>
> i.e. something in syscomments or similiar?
>
>
> thanks
>
>
> C