Results 1 to 3 of 3

Thread: Can not find stored procedure DBCC

  1. #1
    Join Date
    Sep 2002
    Location
    San Diego, CA
    Posts
    15

    Can not find stored procedure DBCC

    In Query Analyzer (SQL 2000), I try to execute a string variable whose contents asked to have DBCC CHECKDB executed and get the following error message:

    DBCC CHECKDB(DS1) WITH NO_INFOMSGS
    Server: Msg 2812, Level 16, State 62, Line 9
    Could not find stored procedure 'DBCC CHECKDB(DS1) WITH NO_INFOMSGS'.

    The following is the code executed:

    Use master
    Declare @String varchar (255)
    set @string = 'DBCC CHECKDB'
    set @string = @string + '('
    set @string = @string + 'DS1'
    set @string = @string + ')'
    SET @string = @string + ' WITH NO_INFOMSGS'
    print @string
    EXEC @string

    The first thing I find perplexing is that I did not think DBCC was a stored procedure.

    Any clues to the problem, comments, etc., would be appreciated.

    TIA solart

  2. #2
    Join Date
    Sep 2002
    Location
    San Diego, CA
    Posts
    15

    Red face Can not find stored procedure DBCC

    Sorry, found I needed parens around my variable @string.

    Syntax error

    solart

  3. #3
    Join Date
    Sep 2002
    Posts
    19
    Try this....

    Use master
    Declare @String varchar (255)
    set @string = 'DBCC CHECKDB'
    set @string = @string + '('
    set @string = @string + 'DS1'
    set @string = @string + ')'
    SET @string = @string + ' WITH NO_INFOMSGS'
    print @string
    EXEC (@string)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •