SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Restore Syntax


Restore Syntax

Author
Message
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894
I'm upgrading a lot of Databases to SQL Server 2008 R2.

I can't get the syntax right.

I'm confused about what to do with the last logical file name?

Please see attached word screen shot.

Thanks.

Edit: I had a typo, syntax error. No pun intended.

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Attachments
Restore.docx (19 views, 39.00 KB)
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894
I atttached the word work with screen shot and tried to open myself but I could not open it?

How can I embed an image intop my post?

Thanks.

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894

RESTORE FILELISTONLY
FROM DISK = 'M:\Backup_2005\Complete\YAFNET_backup_2013_11_21_192534_3162500.bak'
GO




LogicalName PhysicalName Type FileGroupName Size
YAFNET Z:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\YAFNET.mdf D PRIMARY 4390912
YAFNET_log Z:\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\YAFNET_log.LDF L NULL 5308416
sysft_YafSearch Z:\Microsoft SQL Server\MSSQL.1\MSSQL\FTData\YafSearch F PRIMARY 468974









RESTORE FILELISTONLY
FROM DISK = 'M:\Backup_2005\Complete\YAFNET_backup_2013_11_21_192534_3162500.bak'
GO

RESTORE DATABASE YAFNET
FROM DISK =
WITH REPLACE,
RECOVERY,
MOVE '' TO 'M:\MSSQL\Data\',
MOVE '' TO 'M:\MSSQL\Log\'

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
homebrew01
homebrew01
SSCertifiable
SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)

Group: General Forum Members
Points: 5037 Visits: 9108
Have you tried using the GUI to set up the restore, then generate the script to a query window ?



Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894
homebrew01 (11/27/2013)
Have you tried using the GUI to set up the restore, then generate the script to a query window ?


Thanks. I restored through the GUI which I never do but it worked.

I'm not sure how to generate a script?

I was not sure what the 3rd file was for?

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
homebrew01
homebrew01
SSCertifiable
SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)SSCertifiable (5K reputation)

Group: General Forum Members
Points: 5037 Visits: 9108
" ... I'm not sure how to generate a script? ... "

Open the GUI, get everything set the way you want. Instead of clicking "OK", select "Script" at the top of the GUI pane.



Perry Whittle
Perry Whittle
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20776 Visits: 17244
Welsh Corgi (11/27/2013)
I atttached the word work with screen shot and tried to open myself but I could not open it?

How can I embed an image intop my post?

Thanks.

I opened it just fine

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894
Thanks.:-)

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Perry Whittle
Perry Whittle
SSC-Insane
SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)SSC-Insane (20K reputation)

Group: General Forum Members
Points: 20776 Visits: 17244
which version\edition of sql server are you using?

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
Welsh Corgi
Welsh Corgi
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10534 Visits: 4894
Perry Whittle (11/29/2013)
which version\edition of sql server are you using?


I'm moving from SQL Server 2005 RTM to SQL Server 2008 R2 and 2012 in the near future.

The server has about 25 Databases on it and they are all on the new Server..

I really don't want to perform any upgrades for I do not want anything to go wrong. I know the risk is low but I do not know what has been to that Server. Reboot and it does not come up I loose a customer.

A bunch of stuff does not work. e.g. I can run a job based on a maintenance plan which is a pain.

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search