Monday, March 12, 2012

list of tables without indexes

Using SS2000 SP4. I found this code:
USE SMCLMS_Dev;
GO
SELECT*
FROM sys.tables
WHERE OBJECTPROPERTY(object_id,'IsIndexed') = 0
ORDER BY table_name;
GO
but when I run it I get "Invalid object name 'sys.tables'."
Thanks,
--
Dan D.That example uses the sys.tables catalog view and is only valid for SQL
Server 2005. For an equivalent example in SQL Server 2000, try this:
SELECT *
FROM sysobjects
WHERE OBJECTPROPERTY(id,'IsIndexed') = 0 and xtype = 'U'
ORDER BY name;
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"Dan D." <DanD@.discussions.microsoft.com> wrote in message
news:266E5467-BFFF-4940-BEFE-4FF479BFCFCF@.microsoft.com...
> Using SS2000 SP4. I found this code:
> USE SMCLMS_Dev;
> GO
> SELECT*
> FROM sys.tables
> WHERE OBJECTPROPERTY(object_id,'IsIndexed') = 0
> ORDER BY table_name;
> GO
> but when I run it I get "Invalid object name 'sys.tables'."
> Thanks,
> --
> Dan D.|||That worked. Thanks Gail.
--
Dan D.
"Gail Erickson [MS]" wrote:
> That example uses the sys.tables catalog view and is only valid for SQL
> Server 2005. For an equivalent example in SQL Server 2000, try this:
> SELECT *
> FROM sysobjects
> WHERE OBJECTPROPERTY(id,'IsIndexed') = 0 and xtype = 'U'
> ORDER BY name;
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "Dan D." <DanD@.discussions.microsoft.com> wrote in message
> news:266E5467-BFFF-4940-BEFE-4FF479BFCFCF@.microsoft.com...
> > Using SS2000 SP4. I found this code:
> >
> > USE SMCLMS_Dev;
> > GO
> > SELECT*
> > FROM sys.tables
> > WHERE OBJECTPROPERTY(object_id,'IsIndexed') = 0
> > ORDER BY table_name;
> > GO
> >
> > but when I run it I get "Invalid object name 'sys.tables'."
> >
> > Thanks,
> > --
> > Dan D.
>
>

No comments:

Post a Comment