Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 DBCC SHOWCONTIG

Author  Topic 

amy
Starting Member

30 Posts

Posted - 2002-05-02 : 09:51:34

DBCC SHOWCONTIG (AddressTypes)

when I excute above statement, I got the following error:
error:Parameter 1 is incorrect for this DBCC statement.

What's wrong?

Thanks

Kevin Snow
Posting Yak Master

149 Posts

Posted - 2002-05-02 : 13:43:55
I get the same error on SQL 7.0, but the same statement syntax works fine on SQL 2000.

In SQL 7.0, you need to look up the table ID. It is expecting an integer parameter rather than a table name.

What version of SQL Server are you on?
Go to Top of Page

amy
Starting Member

30 Posts

Posted - 2002-05-02 : 13:49:28
2K
==============
USE DatabaseName
GO
DECLARE @ID INT,
@IndxID int,
@IndexName varchar(128)

SELECT @IndexName = 'IndexName
set @id = Object_ID('TableName')
select @indxID = IndID
from sysindexes
where id = @ID
and name = @indexname
dbcc showcontig(@id, @indxid)
GO
===============

It work fine with statment above . Do you know any way to look up all tables at one time?

Thanks

quote:

I get the same error on SQL 7.0, but the same statement syntax works fine on SQL 2000.

In SQL 7.0, you need to look up the table ID. It is expecting an integer parameter rather than a table name.

What version of SQL Server are you on?



Go to Top of Page
   

- Advertisement -