Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Restore Syntax Expand / Collapse
Author
Message
Posted Wednesday, November 27, 2013 9:27 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/



  Post Attachments 
Restore.docx (16 views, 39.41 KB)
Post #1518126
Posted Wednesday, November 27, 2013 10:14 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/

Post #1518140
Posted Wednesday, November 27, 2013 10:17 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/

Post #1518144
Posted Wednesday, November 27, 2013 11:14 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:06 PM
Points: 2,827, Visits: 8,479
Have you tried using the GUI to set up the restore, then generate the script to a query window ?


Post #1518156
Posted Wednesday, November 27, 2013 2:58 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/

Post #1518218
Posted Wednesday, November 27, 2013 3:45 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:06 PM
Points: 2,827, Visits: 8,479
" ... 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.



Post #1518221
Posted Friday, November 29, 2013 7:08 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:48 AM
Points: 6,369, Visits: 13,703
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"
Post #1518549
Posted Friday, November 29, 2013 8:14 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/

Post #1518559
Posted Friday, November 29, 2013 8:22 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:48 AM
Points: 6,369, Visits: 13,703
which version\edition of sql server are you using?

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

"Ya can't make an omelette without breaking just a few eggs"
Post #1518560
Posted Friday, November 29, 2013 8:43 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 7:44 PM
Points: 4,232, Visits: 4,284
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/

Post #1518564
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse