If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Restore point in time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-11, 07:55
Alren Alren is offline
Registered User
 
Join Date: Jun 2007
Posts: 12
Restore point in time

Hi there,

In there a t-sql statement that permits to load all the backups and log files in NORECOVERY and AFTER

I was thinking of something like this (incorrect syntax)
<code>restore log TestRestore with STOPAT = '2011-12-01 11:11:42.000', RECOVERY;</code>
Reply With Quote
  #2 (permalink)  
Old 12-01-11, 12:17
randirsa randirsa is offline
Registered User
 
Join Date: Nov 2011
Posts: 21
Reply With Quote
  #3 (permalink)  
Old 12-05-11, 03:32
Alren Alren is offline
Registered User
 
Join Date: Jun 2007
Posts: 12
Restore point in time

This article is +/- what I want to do except that I'd like to do a point in time restore.
Instead of the line
Code:
SELECT 999999999 AS backup_set_id, 'RESTORE DATABASE ' + @databaseName + ' WITH RECOVERY'
I would like something that did a point in time (if this is possible)

Thanks for your reply
Alren
Reply With Quote
  #4 (permalink)  
Old 12-05-11, 07:57
randirsa randirsa is offline
Registered User
 
Join Date: Nov 2011
Posts: 21
it seems you have missed the backup location .
This is syntax for restoring point in time.


RESTORE LOG AdventureWorks2008R2
FROM AdventureWorks2008R2Backups
With NORECOVERY, STOPAT = 'Apr 15, 2020 12:00 AM';

RESTORE DATABASE AdventureWorks2008R2 WITH RECOVERY;
Reply With Quote
  #5 (permalink)  
Old 12-05-11, 08:21
Alren Alren is offline
Registered User
 
Join Date: Jun 2007
Posts: 12
Thanks
This answers my question.

Alren
Reply With Quote
Reply

Tags
sqlserver

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On