Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

How to restore the latest backupset in sql server 2008

$
0
0

Friends,

Server: Win2k3

DB: Sql server 2008 Ent. Edition

Client pc: winxp sp3 & Sql Server 2008 Dev. Edition

Daily i am taking full backup from server and i am restoring it in my local pc.

i am using T-SQL to restore...

restore database cbt1 from disk='D:\DailyDBbackup\cbt1.BAK'
with 
move 'cbt1' to 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\cbt1.mdf',
move 'cbt1_log' to 'D:\Program Files\Microsoft SQL Server\MSSQL\Data\cbt1_log.ldf'
go

but the above command is not restoring the latest backupsets...but when i restore using SSMS then its displaying all the backup sets and i am selecting the latest one...but i have 10 databases..for each database i have to do it separately thru SSMS...thats why i wrote the restore script for all the 10 dbs...

so how can i alter the above restore script to restore the db with the latest backup set?

thanks & regards



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>