Restore database

  • I am working a database and created some stored procedures in that about 10 days before..somehow today I restore it with current database which dont have those SP...

    Is there any way to restore the database in which I created SP 10 days before...

    plzz suggest

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Get a backup that does have those procedures in and restore it as a new DB. Copy the procs 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
  • But I dont know that if the backup of that database is exist on sytem or not as I didnt take any backup of that...

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Then you'll have to rewrite them. When you restored a DB over the one with the procs, those procs were lost.

    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
  • ohhh....

    Means if I delete any database then we cant restore it back anyhow?

    Is there any way using logs file...

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Errr.. backups. That's what they are there for.

    If you restored over or deleted a backup, the transaction logs would be gone too, not that they are a way of recovering an entire database without backups anyway.

    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
  • thanks for the information Gila

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

  • Also, going forward, treat your database code the same way as developers treat application code. Put all your stored procedures (I'd say all your database objects) into source control. That way you keep a copy separate from the database and you have versions and tracking and all the good things that source control gives you.

    "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

Viewing 8 posts - 1 through 7 (of 7 total)

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