Results 1 to 5 of 5

Thread: DBCC command in a stored procedure

  1. #1
    Christian Bellavance Guest

    DBCC command in a stored procedure

    Is it possible to execute a DBCC command in a stored procedures. I have try it and i always get a syntax error near DBCC event if i used the EXECUTE command before.

    Thanks.

  2. #2
    DeltonBlackwell Guest

    DBCC command in a stored procedure (reply)

    On 6/26/98 2:16:55 PM, Christian Bellavance wrote:
    > Is it possible to execute a DBCC command in a stored procedures. I have
    > try it and i always get a syntax error near DBCC event if i used the
    > EXECUTE command before.

    Thanks.

    You should be able to run dbcc commands. What specific command are you trying to run

  3. #3
    Christian Bellavance Guest

    DBCC command in a stored procedure (reply)

    On 6/26/98 2:27:56 PM, DeltonBlackwell wrote:
    > On 6/26/98 2:16:55 PM, Christian Bellavance wrote:
    > Is it possible to
    > execute a DBCC command in a stored procedures. I have
    > try it and i
    > always get a syntax error near DBCC event if i used the
    > EXECUTE command
    > before.

    Thanks.

    You should be able to run dbcc commands. What
    > specific command are you trying to run

    I`m trying to do something like this:

    if @a > @b
    begin
    execute DBCC DBREINDEX(`MyTable`)
    end

  4. #4
    Levi Akers Guest

    DBCC command in a stored procedure (reply)

    On 6/29/98 8:53:03 AM, Christian Bellavance wrote:
    > On 6/26/98 2:27:56 PM, DeltonBlackwell wrote:
    > On 6/26/98 2:16:55 PM,
    > Christian Bellavance wrote:
    > Is it possible to
    > execute a DBCC
    > command in a stored procedures. I have
    > try it and i
    > always get a
    > syntax error near DBCC event if i used the
    > EXECUTE command
    >
    > before.

    Thanks.

    You should be able to run dbcc commands. What
    >
    > specific command are you trying to run

    I`m trying to do something like
    > this:

    if @a > @b
    begin
    execute DBCC DBREINDEX(`MyTable`)
    end

    Try removing the execute before the DBCC so it reads...

    if @a > @b
    begin
    DBCC DBREINDEX(`MyTable`)
    end

    That should work.

    Levi Akers

  5. #5
    Christian Bellavance Guest

    DBCC command in a stored procedure (reply)

    On 6/30/98 7:19:22 AM, Levi Akers wrote:
    > On 6/29/98 8:53:03 AM, Christian Bellavance wrote:
    > On 6/26/98 2:27:56
    > PM, DeltonBlackwell wrote:
    > On 6/26/98 2:16:55 PM,
    > Christian
    > Bellavance wrote:
    > Is it possible to
    > execute a DBCC
    > command in a
    > stored procedures. I have
    > try it and i
    > always get a
    > syntax
    > error near DBCC event if i used the
    > EXECUTE command
    >
    >
    > before.

    Thanks.

    You should be able to run dbcc commands. What
    >
    >
    > specific command are you trying to run

    I`m trying to do something like
    >
    > this:

    if @a > @b
    begin
    execute DBCC
    > DBREINDEX(`MyTable`)
    end

    Try removing the execute before the DBCC
    > so it reads...

    if @a > @b
    begin
    DBCC
    > DBREINDEX(`MyTable`)
    end

    That should work.

    Levi Akers

    It works, Thanks you very much.

Posting Permissions

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