Restore a View Sql Server 2005

110 pts.
Tags:
SQL Server 2005
SQL Server views
I over-wrote a VIEW by mistake. How do I recover the original version of the view? Is there a way to ROLLBACK a "CREATE VIEW..." command?

Software/Hardware used:
SQL Server 2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

If your database is in the SIMPLE recovery mode then no there’s no way to get the schema for the view back.

If your database is in FULL or BULK LOGGED recovery mode then you can use Quest’s LiteSpeed or Lumigent’s Log Explorer (I think Red Gate has a log reader product as well) to find the transaction and roll back the transaction.

If you have a database backup which has the correct schema of the view in it, you can use Quest’s LiteSpeed to restore just the schema for that view from the database backup.

If you don’t have any of those products, but you have a backup of the database, restore the backup to another server (or the same server, but with a different database name) and get the correct schema for the view from there.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following