Andrew J. Kelly SQL MVP
"Edmund" <die_spambot@hatespam.com> wrote in message
news:eqI4GK$GIHA.1316@TK2MSFTNGP02.phx.gbl...
> Hi Andrew,
>
> I've tried the following but with the database name in place of {db} and
> so on. It does not get me anything. Does that mean there is no execution
> plan in the database for it. I've run the stored proceedure so there
> should be something there.
> SELECT *
>
> FROM sys.dm_exec_query_stats
>
> WHERE sql_handle = OBJECT_ID('{db}.{scheme}.{name}')
>
>
> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
> news:elAsFR%23GIHA.5544@TK2MSFTNGP02.phx.gbl...
>> It is not a stored procedure it is a view. More specifically a Dynamic
>> Management View or DMV. You can find details in BooksOnLine.
>>
>> --
>> Andrew J. Kelly SQL MVP
>> Solid Quality Mentors
>>
>>
>> "Edmund" <die_spambot@hatespam.com> wrote in message
>> news:OEUS7E%23GIHA.280@TK2MSFTNGP03.phx.gbl...
>>> Hi Andrew,
>>>
>>> What is the the sys.dm_exec_query_stats DMV? I've looked in the systems
>>> stored procedures in the database but do not see one by that name.
>>>
>>> E
>>>
>>> "Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
>>> news:%23$A3sLbGIHA.1208@TK2MSFTNGP03.phx.gbl...
>>>> If you are on SQL 2005 have a look at the sys.dm_exec_query_stats DMV.
>>>> The Creation_Time should give you what you want.
>>>>
>>>> --
>>>> Andrew J. Kelly SQL MVP
>>>> Solid Quality Mentors
>>>>
>>>>
>>>> "Edmund" <die_spambot@hatespam.com> wrote in message
>>>> news:OW10fSXGIHA.4584@TK2MSFTNGP03.phx.gbl...
>>>>>
>>>>> Thanks Adam, I'll give this a try. By the way, if any does know how
>>>>> to select this information from the system tables, I'm still checking
>>>>> this thread for an answer.
>>>>>
>>>>> "Adam Machanic" <amachanic@IHATESPAMgmail.com> wrote in message
>>>>> news:04F4785E-C06F-4282-A550-93D5572640F8@microsoft.com...
>>>>>>I am not aware of any way to query that information from the system
>>>>>>catalog. What you can do if you want to start monitoring recompiles is
>>>>>>set up a server-side trace and watch the SP:Recompile event. You can
>>>>>>periodically insert the trace data into a table, and then you will
>>>>>>have your own running record of what happened. The recompile event
>>>>>>populates an EventSubStatus column that will tell you why the
>>>>>>recompile occurred.
>>>>>>
>>>>>> For more information see:
>>>>>>
http://msdn2.microsoft.com/en-us/library/ms187105.aspx >>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Adam Machanic
>>>>>> SQL Server MVP -
http://sqlblog.com >>>>>>
>>>>>> Author, "Expert SQL Server 2005 Development"
>>>>>>
http://www.apress.com/book/bookDisplay.html?bID=10220 >>>>>>
>>>>>>
>>>>>>
>>>>>> "Edmund" <die_spambot@hatespam.com> wrote in message
>>>>>> news:%23YHLLr9FIHA.5544@TK2MSFTNGP02.phx.gbl...
>>>>>>> Hello,
>>>>>>>
>>>>>>> Does anyone know how to select the last time a stored procedure was
>>>>>>> compile and which recompile condition caused it?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> E
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>