retrieve the previous version of a stored procedure

  • Hi

    Is there any way to retrieve the previous version of a stored procedure after compilation and closing the window?

    please please help

    regards

    pooja

  • Find a backup of the DB that has the version of the proc that you want. Restore that alongside the existing DB and then script out the procedure

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Using the same DB... I mean without using backup ... we cant restore a stored procedure to the previous version.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

  • Gauthama Kolivad (12/10/2008)


    Using the same DB... I mean without using backup ... we cant restore a stored procedure to the previous version.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

    you can generate the script the sp for previous ver. if it is not encrypted.

  • Kishore.P (12/10/2008)


    you can generate the script the sp for previous ver. if it is not encrypted.

    How, if the proc has been written over?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Pull a previous copy out of source control...

    If you don't have your code under source control, here's the wake-up call to get it there.

    You can't retrieve a previous copy from the current database. It's gone.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (12/10/2008)


    Pull a previous copy out of source control...

    If you don't have your code under source control, here's the wake-up call to get it there.

    You can't retrieve a previous copy from the current database. It's gone.

    I second that!


    [font="Arial Narrow"](PHB) I think we should build an SQL database. (Dilbert) What color do you want that database? (PHB) I think mauve has the most RAM.[/font]

  • Kishore.P (12/10/2008)


    Gauthama Kolivad (12/10/2008)


    Using the same DB... I mean without using backup ... we cant restore a stored procedure to the previous version.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

    you can generate the script the sp for previous ver. if it is not encrypted.

    I would really like to know how this can be done.... Never heard of any method to do this.

    -Roy

  • Roy Ernest (12/11/2008)


    Kishore.P (12/10/2008)


    Gauthama Kolivad (12/10/2008)


    Using the same DB... I mean without using backup ... we cant restore a stored procedure to the previous version.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

    you can generate the script the sp for previous ver. if it is not encrypted.

    I would really like to know how this can be done.... Never heard of any method to do this.

    I think it was a misunderstanding. I've never heard of a mechanism for doing this either.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I think there is a miscommunication..... with the message I have posted.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

    I mean to say if we have backup ... where we have older version of the procedure.... we can restore to the previous version.. by restoring the database backup... and taking old sp from that backup.

    I think it was a misunderstanding. I've never heard of a mechanism for doing this either.

    Yes there is not mechanism for restoring to the previous version with any other method.

  • I think there is a miscommunication..... with the message I have posted.

    As Gail Shaw mentioned if you have backup of the database where you have the previous version of the procedure you can restore using the backup.

    I mean to say if we have backup ... where we have older version of the procedure.... we can restore to the previous version.. by restoring the database backup... and taking old sp from that backup.

    I think it was a misunderstanding. I've never heard of a mechanism for doing this either.

    Yes there is no mechanism for restoring to the previous version with any other method.

  • You can restore it from a database backup even without restoring the backup. You need a tool for comparing and synchronizing object schemas (such as SQL Diff). Set the database backup as a source, the live database as a destination, filter only the stored procedure you want to restore

  • Please note: 4 year old thread

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 13 posts - 1 through 12 (of 12 total)

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