Friday, March 23, 2012

How to find which tables have been pinned in memory.

Is there a way to find which tables are pinned in memory ?
-Nags
SELECT table_name
FROM information_schema.tables
WHERE OBJECTPROPERTY(OBJECT_ID(table_schema + '.' + table_name),
'TableIsPinned') = 1
Jacco Schalkwijk
SQL Server MVP
"Nags" <nags@.DontSpamMe.com> wrote in message
news:u5GzR1JeEHA.4068@.TK2MSFTNGP11.phx.gbl...
> Is there a way to find which tables are pinned in memory ?
> -Nags
>
|||Hello,
Use the property "TableIsPinned" property with Objectproperty function.
1 = True (in memory)
0 = False
usage
select objectproperty('tableid','TableIsPinned)
How to get the table id:-
select object_id('table_name')
Thanks
Hari
MCDBA
"Nags" <nags@.DontSpamMe.com> wrote in message
news:u5GzR1JeEHA.4068@.TK2MSFTNGP11.phx.gbl...
> Is there a way to find which tables are pinned in memory ?
> -Nags
>
|||Got it. Thank you
-Nags
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid > wrote
in message news:uS71O8JeEHA.3412@.TK2MSFTNGP11.phx.gbl...
> SELECT table_name
> FROM information_schema.tables
> WHERE OBJECTPROPERTY(OBJECT_ID(table_schema + '.' + table_name),
> 'TableIsPinned') = 1
>
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "Nags" <nags@.DontSpamMe.com> wrote in message
> news:u5GzR1JeEHA.4068@.TK2MSFTNGP11.phx.gbl...
>

No comments:

Post a Comment