Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to check stored procedure?

    Hello, everyone:

    I have some stored procedures that run on SQL2K(SP3) /WIN2K. Sometimes I modify them using ALTER PROCEDURE statements. How to check if they are changed after ALTER statements run? Thanks.

    ZYT

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    For a procedure named myProc, I would probably use:
    Code:
    EXECUTE sp_helptext myProc
    -PatP

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You can compare the binarychecksum value of the procedure before and after your ALTER statement.

    Please give some more details about what you are doing and why.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Mar 2003
    Posts
    223
    Hello, Blindman:

    Thanks for reply. Follow Pat, the SP name is MyProc as
    CREATE PROC MyProc
    @score INT
    AS
    SELECT * FROME MyReport

    I want to change @scroe data type and run:
    ALTER PROC MyProc
    @score SMALLINT
    SELECT * FROM MyReport

    How to check if @score has been changed to SMALLINT? Thanks a lot.

    ZYT

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    If you execute the code snippet that I posted earlier, it will show you the source code of the stored procedure as the server "sees" it. You can just read the procedure's source code to verify that it does what you think it should.

    -PatP

Posting Permissions

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