Partner links

Microsoft SQL Server: How to find not partitioned tables




Script to find not partitioned tables containing some particular column
SELECT o2.NAME FROM sys.objects o

INNER JOIN sys.indexes i ON o.OBJECT_ID=i.OBJECT_ID
INNER JOIN sys.partition_schemes ps ON ps.data_space_id=i.data_space_id
RIGHT OUTER JOIN sys.Objects o2 ON o2.OBJECT_ID=o.OBJECT_ID
INNER JOIN sys.columns c ON c.OBJECT_ID=o2.OBJECT_ID
WHERE o2.TYPE_DESC='USER_TABLE' AND c.NAME='mycolumnname' AND o.OBJECT_ID IS null

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>