DBCC Commands

  • Im trying to execute a DBCC command on a table owned by a non dbo user.. I have having sa rights. even then when I try to execute the command as

    dbcc showcontig (<tablename&gt

    I am getting error saying that the object does not exists. when I try to qualify like

     

    dbcc showcontig (objectowner.tablename)

    I am getting incorrect syntax error. any clues why?

     

     

    with smiles

    santhosh

     

  • Input for is a string

    if you do dbcc showcontig (objectowner.tablename) you get an error. But if you do

    dbcc showcontig ('objectowner.tablename') it should work.

    or you can do

    declare @TableID int

    select @TableID = (OBJECT_ID('objectowner.tablename'))

    dbcc showcontig (@TableID)

    Please look up dbcc showcontig in books online

  • Santhosh,

    If I understand, all you need to do is enclose the owner and table name in single quotes.

    DBCC SHOWCONTIG('bill.tablename')

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply