Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Unanswered: Get Stored Procedure

    I know you can alter and create stored procedures, but is there a way to select a stored procedure? I rewrote some stored procedures for a database and now I want to go and update all the sites using that database(copies), but first I want to make sure that there were no other changes. So what I want to do is to write a page that will get the current stored procedure, compare it to what it should be, and if they are the same only them update it. Is this at all possible?

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    [YODA MODE]
    query on sysobjects and syscomments, and the answer to your question you shall find.
    [/YODA MODE]
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    This code returns a checksum value on each database object:
    Code:
    select	sysobjects.id,
    	sysobjects.name,
    	sysobjects.type,
    	sum(cast(checksum(syscomments.text) as bigint)) Object_Checksum
    from	sysobjects
    	inner join syscomments on sysobjects.id = syscomments.id
    group by sysobjects.id,
    	sysobjects.name,
    	sysobjects.type
    If the checksum value of the old object does not match the checksum value of the new object, then the object definition has changed.
    If it's not practically useful, then it's practically useless.

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

Posting Permissions

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