Need to restore the db from network location.
After I click restore from device. The select path box is grayed out. I
could not type the network path.
(I know i could restore it in query analyzer by using restore code.)
Any ideas?
ThanksDid you press the ... button to the right of that text box?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
> Need to restore the db from network location.
> After I click restore from device. The select path box is grayed out. I
> could not type the network path.
> (I know i could restore it in query analyzer by using restore code.)
> Any ideas?
> Thanks
>|||I did, Just let you select local divers only
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23mgSe1B9GHA.3916@.TK2MSFTNGP04.phx.gbl...
> Did you press the ... button to the right of that text box?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
>> Need to restore the db from network location.
>> After I click restore from device. The select path box is grayed out. I
>> could not type the network path.
>> (I know i could restore it in query analyzer by using restore code.)
>> Any ideas?
>> Thanks|||mecn wrote:
> I did, Just let you select local divers only
>
Correct, you can't point/click to a network path, but you can TYPE the
path into the filename field on that same window...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||The problem is I could not. The box is grayed out.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
>> I did, Just let you select local divers only
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I couldn't type. Is it sort of permission issue?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
>> I did, Just let you select local divers only
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||sorry. you are saying that I could type the network path in to the file name
box?
i.e. \\network\servover\dir\abc.bak?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
>> I did, Just let you select local divers only
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I don't think taht you could type the path and file name into filename box.
Filename box is only for file name like abc.bak. right?!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
>> I did, Just let you select local divers only
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I am sorry, you are right!!!! I could type the network path into file name
box and it works--THANK YOU VERY MUCH!!!@.!!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
>> I did, Just let you select local divers only
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||mecn wrote:
> I am sorry, you are right!!!! I could type the network path into file name
> box and it works--THANK YOU VERY MUCH!!!@.!!
>
Great... Now that you've accomplished that, can you explain why this
was easier than just issuing the RESTORE DATABASE command in a query window?
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Showing posts with label path. Show all posts
Showing posts with label path. Show all posts
Friday, March 30, 2012
restore db from device in sql2005
Need to restore the db from network location.
After I click restore from device. The select path box is grayed out. I
could not type the network path.
(I know i could restore it in query analyzer by using restore code.)
Any ideas?
Thanks
Did you press the ... button to the right of that text box?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
> Need to restore the db from network location.
> After I click restore from device. The select path box is grayed out. I
> could not type the network path.
> (I know i could restore it in query analyzer by using restore code.)
> Any ideas?
> Thanks
>
|||I did, Just let you select local divers only
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23mgSe1B9GHA.3916@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you press the ... button to the right of that text box?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
|||mecn wrote:
> I did, Just let you select local divers only
>
Correct, you can't point/click to a network path, but you can TYPE the
path into the filename field on that same window...
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||The problem is I could not. The box is grayed out.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I couldn't type. Is it sort of permission issue?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||sorry. you are saying that I could type the network path in to the file name
box?
i.e. \\network\servover\dir\abc.bak?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I don't think taht you could type the path and file name into filename box.
Filename box is only for file name like abc.bak. right?!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I am sorry, you are right!!!! I could type the network path into file name
box and it works--THANK YOU VERY MUCH!!!@.!!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||mecn wrote:
> I am sorry, you are right!!!! I could type the network path into file name
> box and it works--THANK YOU VERY MUCH!!!@.!!
>
Great... Now that you've accomplished that, can you explain why this
was easier than just issuing the RESTORE DATABASE command in a query window?
Tracy McKibben
MCDBA
http://www.realsqlguy.com
After I click restore from device. The select path box is grayed out. I
could not type the network path.
(I know i could restore it in query analyzer by using restore code.)
Any ideas?
Thanks
Did you press the ... button to the right of that text box?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
> Need to restore the db from network location.
> After I click restore from device. The select path box is grayed out. I
> could not type the network path.
> (I know i could restore it in query analyzer by using restore code.)
> Any ideas?
> Thanks
>
|||I did, Just let you select local divers only
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23mgSe1B9GHA.3916@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you press the ... button to the right of that text box?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...
|||mecn wrote:
> I did, Just let you select local divers only
>
Correct, you can't point/click to a network path, but you can TYPE the
path into the filename field on that same window...
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||The problem is I could not. The box is grayed out.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I couldn't type. Is it sort of permission issue?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||sorry. you are saying that I could type the network path in to the file name
box?
i.e. \\network\servover\dir\abc.bak?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I don't think taht you could type the path and file name into filename box.
Filename box is only for file name like abc.bak. right?!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||I am sorry, you are right!!!! I could type the network path into file name
box and it works--THANK YOU VERY MUCH!!!@.!!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
|||mecn wrote:
> I am sorry, you are right!!!! I could type the network path into file name
> box and it works--THANK YOU VERY MUCH!!!@.!!
>
Great... Now that you've accomplished that, can you explain why this
was easier than just issuing the RESTORE DATABASE command in a query window?
Tracy McKibben
MCDBA
http://www.realsqlguy.com
restore db from device in sql2005
Need to restore the db from network location.
After I click restore from device. The select path box is grayed out. I
could not type the network path.
(I know i could restore it in query analyzer by using restore code.)
Any ideas?
ThanksDid you press the ... button to the right of that text box?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...[v
bcol=seagreen]
> Need to restore the db from network location.
> After I click restore from device. The select path box is grayed out. I
> could not type the network path.
> (I know i could restore it in query analyzer by using restore code.)
> Any ideas?
> Thanks
>[/vbcol]|||I did, Just let you select local divers only
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23mgSe1B9GHA.3916@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you press the ... button to the right of that text box?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...|||mecn wrote:
> I did, Just let you select local divers only
>
Correct, you can't point/click to a network path, but you can TYPE the
path into the filename field on that same window...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||The problem is I could not. The box is grayed out.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I couldn't type. Is it sort of permission issue?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||sorry. you are saying that I could type the network path in to the file name
box?
i.e. \\network\servover\dir\abc.bak?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I don't think taht you could type the path and file name into filename box.
Filename box is only for file name like abc.bak. right?!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I am sorry, you are right!!!! I could type the network path into file name
box and it works--THANK YOU VERY MUCH!!!@.!!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||mecn wrote:
> I am sorry, you are right!!!! I could type the network path into file name
> box and it works--THANK YOU VERY MUCH!!!@.!!
>
Great... Now that you've accomplished that, can you explain why this
was easier than just issuing the RESTORE DATABASE command in a query window?
Tracy McKibben
MCDBA
http://www.realsqlguy.comsql
After I click restore from device. The select path box is grayed out. I
could not type the network path.
(I know i could restore it in query analyzer by using restore code.)
Any ideas?
ThanksDid you press the ... button to the right of that text box?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"mecn" <mecn2002@.yahoo.com> wrote in message news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...[v
bcol=seagreen]
> Need to restore the db from network location.
> After I click restore from device. The select path box is grayed out. I
> could not type the network path.
> (I know i could restore it in query analyzer by using restore code.)
> Any ideas?
> Thanks
>[/vbcol]|||I did, Just let you select local divers only
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23mgSe1B9GHA.3916@.TK2MSFTNGP04.phx.gbl...[vbcol=seagreen]
> Did you press the ... button to the right of that text box?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "mecn" <mecn2002@.yahoo.com> wrote in message
> news:ud2imO78GHA.4224@.TK2MSFTNGP02.phx.gbl...|||mecn wrote:
> I did, Just let you select local divers only
>
Correct, you can't point/click to a network path, but you can TYPE the
path into the filename field on that same window...
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||The problem is I could not. The box is grayed out.
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I couldn't type. Is it sort of permission issue?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||sorry. you are saying that I could type the network path in to the file name
box?
i.e. \\network\servover\dir\abc.bak?
Thanks
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I don't think taht you could type the path and file name into filename box.
Filename box is only for file name like abc.bak. right?!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||I am sorry, you are right!!!! I could type the network path into file name
box and it works--THANK YOU VERY MUCH!!!@.!!
"Tracy McKibben" <tracy@.realsqlguy.com> wrote in message
news:4538D8BB.7050509@.realsqlguy.com...
> mecn wrote:
> Correct, you can't point/click to a network path, but you can TYPE the
> path into the filename field on that same window...
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com|||mecn wrote:
> I am sorry, you are right!!!! I could type the network path into file name
> box and it works--THANK YOU VERY MUCH!!!@.!!
>
Great... Now that you've accomplished that, can you explain why this
was easier than just issuing the RESTORE DATABASE command in a query window?
Tracy McKibben
MCDBA
http://www.realsqlguy.comsql
Monday, March 26, 2012
restore database using OSQL
Dear Sir/Madam,
Would you please help me to create a batch file to restore a database from a file located on a remote path to my MSDE installed on my workstation.
the original database location was on the D drive on the server
but when i want to restore it to my MSDE it will be in a different path which is C
I want to create a command batch file by just double clicking on it, it will restore the database. (i want a forced restoration).
Please proivde me with your help.
Regards,
HotBirdLook up RESTORE DATABASE in BOL. It's all there.|||Please check this script is it runnable and right
OSQL -U sa - P xxxx RESTORE DATABASE mydb FROM DISK = '\\195.xxx.xxx.xxx\dolphindata\30704'
WITH REPLACE, MOVE 'mydb_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_Data.MDF',MOVE 'mydb_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_LOG.LDF' QUIT
I put this script in a file called "restore.bat"
Please advise me
Thanks in advance
HotBird|||Surround your RESTORE...by quotation marks and loose QUIT:
OSQL -U sa - P xxxx "RESTORE DATABASE mydb FROM DISK = '\\195.xxx.xxx.xxx\dolphindata\30704'
WITH REPLACE, MOVE 'mydb_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_Data.MDF',MOVE 'mydb_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_LOG.LDF'"
Would you please help me to create a batch file to restore a database from a file located on a remote path to my MSDE installed on my workstation.
the original database location was on the D drive on the server
but when i want to restore it to my MSDE it will be in a different path which is C
I want to create a command batch file by just double clicking on it, it will restore the database. (i want a forced restoration).
Please proivde me with your help.
Regards,
HotBirdLook up RESTORE DATABASE in BOL. It's all there.|||Please check this script is it runnable and right
OSQL -U sa - P xxxx RESTORE DATABASE mydb FROM DISK = '\\195.xxx.xxx.xxx\dolphindata\30704'
WITH REPLACE, MOVE 'mydb_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_Data.MDF',MOVE 'mydb_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_LOG.LDF' QUIT
I put this script in a file called "restore.bat"
Please advise me
Thanks in advance
HotBird|||Surround your RESTORE...by quotation marks and loose QUIT:
OSQL -U sa - P xxxx "RESTORE DATABASE mydb FROM DISK = '\\195.xxx.xxx.xxx\dolphindata\30704'
WITH REPLACE, MOVE 'mydb_Data' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_Data.MDF',MOVE 'mydb_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\mydb_LOG.LDF'"
Wednesday, March 7, 2012
restore a sql db
Hi,
I received a sql xxx.mdf file. I believe it is a copy
after detached from the server.
But I don't know the path. When I tried to attach it back
to my sql server, I received error "Error 5173 Cannot
associate files with different databases."
Any suggestion?
ThanksIF the database is a single mdf file... use
sp_attach_single_file_db databasename, "Fully qualified mdf filename"
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs.com> wrote in message
news:028201c3debe$7ba77370$a101280a@.phx.gbl...
> Hi,
> I received a sql xxx.mdf file. I believe it is a copy
> after detached from the server.
> But I don't know the path. When I tried to attach it back
> to my sql server, I received error "Error 5173 Cannot
> associate files with different databases."
> Any suggestion?
> Thanks|||this is what I got when I used sp_attached_single db
Server: Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The
system cannot find the path specified.) while attempting
to open or create the physical
file 'E:\NewData\Log\ezteller_log.LDF'.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'ezteller'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Program Files\Microsoft SQL
Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
I know the database name, but I don't the file path. Does
it matter?
>--Original Message--
>IF the database is a single mdf file... use
>sp_attach_single_file_db databasename, "Fully qualified
mdf filename"
>
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Computer Education Services Corporation (CESC),
Charlotte, NC
>www.computeredservices.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>
>"frankie" <frank.su@.harlandfs.com> wrote in message
>news:028201c3debe$7ba77370$a101280a@.phx.gbl...
>> Hi,
>> I received a sql xxx.mdf file. I believe it is a copy
>> after detached from the server.
>> But I don't know the path. When I tried to attach it
back
>> to my sql server, I received error "Error 5173 Cannot
>> associate files with different databases."
>> Any suggestion?
>> Thanks
>
>.
>|||No, the file path doesn't matter... You simply use the path you copy the
file to... Let's say you copy the file to D:\data\SQL\ezteller.mdf, then
the command would be
Sp_attach_single_file_db ezteller, 'D:\data\SQL\ezteller.mdf'
The error message is whining about the log file however... Are you sure you
are
1. Using sp_attach_single_file_db and NOT sp_attach_db and
2. The file you are attaching is ACTUALLY an MDF file and not a log file?
and
3. The directory etc actually already exists with the mdf file copied to it?
AND
4. the SQL Server login has read/write permissions on the file?
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs> wrote in message
news:0a5501c3dec6$e6f9b040$a501280a@.phx.gbl...
> this is what I got when I used sp_attached_single db
> Server: Msg 5123, Level 16, State 1, Line 1
> CREATE FILE encountered operating system error 3(The
> system cannot find the path specified.) while attempting
> to open or create the physical
> file 'E:\NewData\Log\ezteller_log.LDF'.
> Server: Msg 1813, Level 16, State 1, Line 1
> Could not open new database 'ezteller'. CREATE DATABASE is
> aborted.
> Device activation error. The physical file
> name 'D:\Program Files\Microsoft SQL
> Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
> I know the database name, but I don't the file path. Does
> it matter?
>
> >--Original Message--
> >IF the database is a single mdf file... use
> >sp_attach_single_file_db databasename, "Fully qualified
> mdf filename"
> >
> >
> >
> >--
> >Wayne Snyder, MCDBA, SQL Server MVP
> >Computer Education Services Corporation (CESC),
> Charlotte, NC
> >www.computeredservices.com
> >(Please respond only to the newsgroups.)
> >
> >I support the Professional Association of SQL Server
> (PASS) and it's
> >community of SQL Server professionals.
> >www.sqlpass.org
> >
> >
> >"frankie" <frank.su@.harlandfs.com> wrote in message
> >news:028201c3debe$7ba77370$a101280a@.phx.gbl...
> >> Hi,
> >> I received a sql xxx.mdf file. I believe it is a copy
> >> after detached from the server.
> >> But I don't know the path. When I tried to attach it
> back
> >> to my sql server, I received error "Error 5173 Cannot
> >> associate files with different databases."
> >>
> >> Any suggestion?
> >>
> >> Thanks
> >
> >
> >.
> >|||I was able to restore the db by create some folders which
I believed the original physical files were at.
Thanks
>--Original Message--
>this is what I got when I used sp_attached_single db
>Server: Msg 5123, Level 16, State 1, Line 1
>CREATE FILE encountered operating system error 3(The
>system cannot find the path specified.) while attempting
>to open or create the physical
>file 'E:\NewData\Log\ezteller_log.LDF'.
>Server: Msg 1813, Level 16, State 1, Line 1
>Could not open new database 'ezteller'. CREATE DATABASE
is
>aborted.
>Device activation error. The physical file
>name 'D:\Program Files\Microsoft SQL
>Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
>I know the database name, but I don't the file path. Does
>it matter?
>
>>--Original Message--
>>IF the database is a single mdf file... use
>>sp_attach_single_file_db databasename, "Fully qualified
>mdf filename"
>>
>>--
>>Wayne Snyder, MCDBA, SQL Server MVP
>>Computer Education Services Corporation (CESC),
>Charlotte, NC
>>www.computeredservices.com
>>(Please respond only to the newsgroups.)
>>I support the Professional Association of SQL Server
>(PASS) and it's
>>community of SQL Server professionals.
>>www.sqlpass.org
>>
>>"frankie" <frank.su@.harlandfs.com> wrote in message
>>news:028201c3debe$7ba77370$a101280a@.phx.gbl...
>> Hi,
>> I received a sql xxx.mdf file. I believe it is a copy
>> after detached from the server.
>> But I don't know the path. When I tried to attach it
>back
>> to my sql server, I received error "Error 5173 Cannot
>> associate files with different databases."
>> Any suggestion?
>> Thanks
>>
>>.
>.
>
I received a sql xxx.mdf file. I believe it is a copy
after detached from the server.
But I don't know the path. When I tried to attach it back
to my sql server, I received error "Error 5173 Cannot
associate files with different databases."
Any suggestion?
ThanksIF the database is a single mdf file... use
sp_attach_single_file_db databasename, "Fully qualified mdf filename"
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs.com> wrote in message
news:028201c3debe$7ba77370$a101280a@.phx.gbl...
> Hi,
> I received a sql xxx.mdf file. I believe it is a copy
> after detached from the server.
> But I don't know the path. When I tried to attach it back
> to my sql server, I received error "Error 5173 Cannot
> associate files with different databases."
> Any suggestion?
> Thanks|||this is what I got when I used sp_attached_single db
Server: Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The
system cannot find the path specified.) while attempting
to open or create the physical
file 'E:\NewData\Log\ezteller_log.LDF'.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'ezteller'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Program Files\Microsoft SQL
Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
I know the database name, but I don't the file path. Does
it matter?
>--Original Message--
>IF the database is a single mdf file... use
>sp_attach_single_file_db databasename, "Fully qualified
mdf filename"
>
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Computer Education Services Corporation (CESC),
Charlotte, NC
>www.computeredservices.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
>community of SQL Server professionals.
>www.sqlpass.org
>
>"frankie" <frank.su@.harlandfs.com> wrote in message
>news:028201c3debe$7ba77370$a101280a@.phx.gbl...
>> Hi,
>> I received a sql xxx.mdf file. I believe it is a copy
>> after detached from the server.
>> But I don't know the path. When I tried to attach it
back
>> to my sql server, I received error "Error 5173 Cannot
>> associate files with different databases."
>> Any suggestion?
>> Thanks
>
>.
>|||No, the file path doesn't matter... You simply use the path you copy the
file to... Let's say you copy the file to D:\data\SQL\ezteller.mdf, then
the command would be
Sp_attach_single_file_db ezteller, 'D:\data\SQL\ezteller.mdf'
The error message is whining about the log file however... Are you sure you
are
1. Using sp_attach_single_file_db and NOT sp_attach_db and
2. The file you are attaching is ACTUALLY an MDF file and not a log file?
and
3. The directory etc actually already exists with the mdf file copied to it?
AND
4. the SQL Server login has read/write permissions on the file?
--
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs> wrote in message
news:0a5501c3dec6$e6f9b040$a501280a@.phx.gbl...
> this is what I got when I used sp_attached_single db
> Server: Msg 5123, Level 16, State 1, Line 1
> CREATE FILE encountered operating system error 3(The
> system cannot find the path specified.) while attempting
> to open or create the physical
> file 'E:\NewData\Log\ezteller_log.LDF'.
> Server: Msg 1813, Level 16, State 1, Line 1
> Could not open new database 'ezteller'. CREATE DATABASE is
> aborted.
> Device activation error. The physical file
> name 'D:\Program Files\Microsoft SQL
> Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
> I know the database name, but I don't the file path. Does
> it matter?
>
> >--Original Message--
> >IF the database is a single mdf file... use
> >sp_attach_single_file_db databasename, "Fully qualified
> mdf filename"
> >
> >
> >
> >--
> >Wayne Snyder, MCDBA, SQL Server MVP
> >Computer Education Services Corporation (CESC),
> Charlotte, NC
> >www.computeredservices.com
> >(Please respond only to the newsgroups.)
> >
> >I support the Professional Association of SQL Server
> (PASS) and it's
> >community of SQL Server professionals.
> >www.sqlpass.org
> >
> >
> >"frankie" <frank.su@.harlandfs.com> wrote in message
> >news:028201c3debe$7ba77370$a101280a@.phx.gbl...
> >> Hi,
> >> I received a sql xxx.mdf file. I believe it is a copy
> >> after detached from the server.
> >> But I don't know the path. When I tried to attach it
> back
> >> to my sql server, I received error "Error 5173 Cannot
> >> associate files with different databases."
> >>
> >> Any suggestion?
> >>
> >> Thanks
> >
> >
> >.
> >|||I was able to restore the db by create some folders which
I believed the original physical files were at.
Thanks
>--Original Message--
>this is what I got when I used sp_attached_single db
>Server: Msg 5123, Level 16, State 1, Line 1
>CREATE FILE encountered operating system error 3(The
>system cannot find the path specified.) while attempting
>to open or create the physical
>file 'E:\NewData\Log\ezteller_log.LDF'.
>Server: Msg 1813, Level 16, State 1, Line 1
>Could not open new database 'ezteller'. CREATE DATABASE
is
>aborted.
>Device activation error. The physical file
>name 'D:\Program Files\Microsoft SQL
>Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
>I know the database name, but I don't the file path. Does
>it matter?
>
>>--Original Message--
>>IF the database is a single mdf file... use
>>sp_attach_single_file_db databasename, "Fully qualified
>mdf filename"
>>
>>--
>>Wayne Snyder, MCDBA, SQL Server MVP
>>Computer Education Services Corporation (CESC),
>Charlotte, NC
>>www.computeredservices.com
>>(Please respond only to the newsgroups.)
>>I support the Professional Association of SQL Server
>(PASS) and it's
>>community of SQL Server professionals.
>>www.sqlpass.org
>>
>>"frankie" <frank.su@.harlandfs.com> wrote in message
>>news:028201c3debe$7ba77370$a101280a@.phx.gbl...
>> Hi,
>> I received a sql xxx.mdf file. I believe it is a copy
>> after detached from the server.
>> But I don't know the path. When I tried to attach it
>back
>> to my sql server, I received error "Error 5173 Cannot
>> associate files with different databases."
>> Any suggestion?
>> Thanks
>>
>>.
>.
>
restore a sql db
Hi,
I received a sql xxx.mdf file. I believe it is a copy
after detached from the server.
But I don't know the path. When I tried to attach it back
to my sql server, I received error "Error 5173 Cannot
associate files with different databases."
Any suggestion?
ThanksIF the database is a single mdf file... use
sp_attach_single_file_db databasename, "Fully qualified mdf filename"
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs.com> wrote in message
news:028201c3debe$7ba77370$a101280a@.phx.gbl...
Server: Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The
system cannot find the path specified.) while attempting
to open or create the physical
file 'E:\NewData\Log\ezteller_log.LDF'.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'ezteller'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Program Files\Microsoft SQL
Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
I know the database name, but I don't the file path. Does
it matter?
mdf filename"
Charlotte, NC
(PASS) and it's
file to... Let's say you copy the file to D:\data\SQL\ezteller.mdf, then
the command would be
Sp_attach_single_file_db ezteller, 'D:\data\SQL\ezteller.mdf'
The error message is whining about the log file however... Are you sure you
are
1. Using sp_attach_single_file_db and NOT sp_attach_db and
2. The file you are attaching is ACTUALLY an MDF file and not a log file?
and
3. The directory etc actually already exists with the mdf file copied to it?
AND
4. the SQL Server login has read/write permissions on the file?
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs> wrote in message
news:0a5501c3dec6$e6f9b040$a501280a@.phx.gbl...[QUOTE]
> this is what I got when I used sp_attached_single db
> Server: Msg 5123, Level 16, State 1, Line 1
> CREATE FILE encountered operating system error 3(The
> system cannot find the path specified.) while attempting
> to open or create the physical
> file 'E:\NewData\Log\ezteller_log.LDF'.
> Server: Msg 1813, Level 16, State 1, Line 1
> Could not open new database 'ezteller'. CREATE DATABASE is
> aborted.
> Device activation error. The physical file
> name 'D:\Program Files\Microsoft SQL
> Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
> I know the database name, but I don't the file path. Does
> it matter?
>
> mdf filename"
> Charlotte, NC
> (PASS) and it's
> back|||I was able to restore the db by create some folders which
I believed the original physical files were at.
Thanks
is
Server\MSSQL\data\EZTeller_Log.LDF'
I received a sql xxx.mdf file. I believe it is a copy
after detached from the server.
But I don't know the path. When I tried to attach it back
to my sql server, I received error "Error 5173 Cannot
associate files with different databases."
Any suggestion?
ThanksIF the database is a single mdf file... use
sp_attach_single_file_db databasename, "Fully qualified mdf filename"
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs.com> wrote in message
news:028201c3debe$7ba77370$a101280a@.phx.gbl...
quote:|||this is what I got when I used sp_attached_single db
> Hi,
> I received a sql xxx.mdf file. I believe it is a copy
> after detached from the server.
> But I don't know the path. When I tried to attach it back
> to my sql server, I received error "Error 5173 Cannot
> associate files with different databases."
> Any suggestion?
> Thanks
Server: Msg 5123, Level 16, State 1, Line 1
CREATE FILE encountered operating system error 3(The
system cannot find the path specified.) while attempting
to open or create the physical
file 'E:\NewData\Log\ezteller_log.LDF'.
Server: Msg 1813, Level 16, State 1, Line 1
Could not open new database 'ezteller'. CREATE DATABASE is
aborted.
Device activation error. The physical file
name 'D:\Program Files\Microsoft SQL
Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
I know the database name, but I don't the file path. Does
it matter?
quote:
>--Original Message--
>IF the database is a single mdf file... use
>sp_attach_single_file_db databasename, "Fully qualified
mdf filename"
quote:
>
>--
>Wayne Snyder, MCDBA, SQL Server MVP
>Computer Education Services Corporation (CESC),
Charlotte, NC
quote:
>www.computeredservices.com
>(Please respond only to the newsgroups.)
>I support the Professional Association of SQL Server
(PASS) and it's
quote:|||No, the file path doesn't matter... You simply use the path you copy the
>community of SQL Server professionals.
>www.sqlpass.org
>
>"frankie" <frank.su@.harlandfs.com> wrote in message
>news:028201c3debe$7ba77370$a101280a@.phx.gbl...
back[QUOTE]
>
>.
>
file to... Let's say you copy the file to D:\data\SQL\ezteller.mdf, then
the command would be
Sp_attach_single_file_db ezteller, 'D:\data\SQL\ezteller.mdf'
The error message is whining about the log file however... Are you sure you
are
1. Using sp_attach_single_file_db and NOT sp_attach_db and
2. The file you are attaching is ACTUALLY an MDF file and not a log file?
and
3. The directory etc actually already exists with the mdf file copied to it?
AND
4. the SQL Server login has read/write permissions on the file?
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"frankie" <frank.su@.harlandfs> wrote in message
news:0a5501c3dec6$e6f9b040$a501280a@.phx.gbl...[QUOTE]
> this is what I got when I used sp_attached_single db
> Server: Msg 5123, Level 16, State 1, Line 1
> CREATE FILE encountered operating system error 3(The
> system cannot find the path specified.) while attempting
> to open or create the physical
> file 'E:\NewData\Log\ezteller_log.LDF'.
> Server: Msg 1813, Level 16, State 1, Line 1
> Could not open new database 'ezteller'. CREATE DATABASE is
> aborted.
> Device activation error. The physical file
> name 'D:\Program Files\Microsoft SQL
> Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
> I know the database name, but I don't the file path. Does
> it matter?
>
> mdf filename"
> Charlotte, NC
> (PASS) and it's
> back|||I was able to restore the db by create some folders which
I believed the original physical files were at.
Thanks
quote:
>--Original Message--
>this is what I got when I used sp_attached_single db
>Server: Msg 5123, Level 16, State 1, Line 1
>CREATE FILE encountered operating system error 3(The
>system cannot find the path specified.) while attempting
>to open or create the physical
>file 'E:\NewData\Log\ezteller_log.LDF'.
>Server: Msg 1813, Level 16, State 1, Line 1
>Could not open new database 'ezteller'. CREATE DATABASE
is
quote:|||Place the file in the path as specified i.e. 'D:\Program Files\Microsoft SQL
>aborted.
>Device activation error. The physical file
>name 'D:\Program Files\Microsoft SQL
>Server\MSSQL\data\EZTeller_Log.LDF' may be incorrect.
>I know the database name, but I don't the file path. Does
>it matter?
>
>mdf filename"
>Charlotte, NC
>(PASS) and it's
>back
>.
>
Server\MSSQL\data\EZTeller_Log.LDF'
Saturday, February 25, 2012
Restore a backup to a different db name and path
I have the following situation:
Database1 on my sql server with the following path: C:\DBs
\Database1.mdf, etc... I made a backup of this database. Now I need
to restore this backup on a different pc into the following: Database2
with the following path C:\Customers\DBS\Database2.mdf, etc... I have
MSDE install on the pc so I dont have the enterprise manager that will
allow me to restore a db and rename the path and file name. What is
the script that I need to run using the osql command?
Thanks
Drop $35 bucks and get the Developer Edition. It has all the tools you need.
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest books:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
Hitchhiker's Guide to SQL Server 2005 Compact Edition
------
"Monica" <Monica@.discussions.microsoft.com> wrote in message
news:42F8C3FE-6410-4083-A3EF-453895ABA12C@.microsoft.com...
>I have the following situation:
> Database1 on my sql server with the following path: C:\DBs
> \Database1.mdf, etc... I made a backup of this database. Now I need
> to restore this backup on a different pc into the following: Database2
> with the following path C:\Customers\DBS\Database2.mdf, etc... I have
> MSDE install on the pc so I dont have the enterprise manager that will
> allow me to restore a db and rename the path and file name. What is
> the script that I need to run using the osql command?
> Thanks
|||=?Utf-8?B?TW9uaWNh?= <Monica@.discussions.microsoft.com> wrote in
news:42F8C3FE-6410-4083-A3EF-453895ABA12C@.microsoft.com:
> I have the following situation:
> Database1 on my sql server with the following path: C:\DBs
> \Database1.mdf, etc... I made a backup of this database. Now I need
> to restore this backup on a different pc into the following: Database2
> with the following path C:\Customers\DBS\Database2.mdf, etc... I have
> MSDE install on the pc so I dont have the enterprise manager that will
> allow me to restore a db and rename the path and file name. What is
> the script that I need to run using the osql command?
> Thanks
something like
RESTORE DATABASE [Database2]
FROM DISK='full_path_of_backup_file'
WITH MOVE 'Database1' TO 'C:\Customers\DBS\Database2.mdf',
MOVE 'Database1_log' TO 'C:\Customers\DBS\Database2_log.ldf'
See BOL for the gory details
|||Thanks...
I tried that but now I get this:
Server: Msg 3234, Level 16, State 2, Line 1
Logical file 'Database1' is not part of database 'Database2'. Use RESTORE
FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
|||=?Utf-8?B?TW9uaWNh?= <Monica@.discussions.microsoft.com> wrote in
news:6C6F4DE3-3AE6-4753-AB7D-4CB063CDA122@.microsoft.com:
> Thanks...
> I tried that but now I get this:
> Server: Msg 3234, Level 16, State 2, Line 1
> Logical file 'Database1' is not part of database 'Database2'. Use
> RESTORE FILELISTONLY to list the logical file names.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
Sorry, it would appear that the 'logical name' of your database is NOT
Database1. To find what the logical name is, do what the message says by
running the query
RESTORE FILELISTONLY
FROM DISK='full_path_of_backup_file'
Then, in what I wrote before
RESTORE DATABASE [Database2]
FROM DISK='full_path_of_backup_file'
WITH MOVE 'Database1' TO 'C:\Customers\DBS\Database2.mdf',
MOVE 'Database1_log' TO 'C:\Customers\DBS\Database2_log.ldf'
change MOVE 'Database1' to be MOVE 'logicalname1' and
MOVE 'Database1_log' to be MOVE 'logicalname2' (probably MOVE
'logicalname1_log') for whatever logicalnames are shown by RESTORE
FILELISTONLY
FWIW I have just run the following renaming-restore successfully for
myself
RESTORE DATABASE [Database2]
FROM DISK='C:\Documents and Settings\chris\My Documents\Databases
\Cambridge-41a-Backup-2005-06-03'
WITH MOVE 'Cambridge-41' TO 'C:\Documents and Settings\chris\My
Documents\Databases\Database2.mdf',
MOVE 'Cambridge-41_log' TO 'C:\Documents and Settings\chris\My
Documents\Databases\Database2_log.ldf'
(cut-and-pasted) so it's just a matter of making the appropriate changes
(making sure that the commas, quotes, etc are in the correct places).
HTH
Database1 on my sql server with the following path: C:\DBs
\Database1.mdf, etc... I made a backup of this database. Now I need
to restore this backup on a different pc into the following: Database2
with the following path C:\Customers\DBS\Database2.mdf, etc... I have
MSDE install on the pc so I dont have the enterprise manager that will
allow me to restore a db and rename the path and file name. What is
the script that I need to run using the osql command?
Thanks
Drop $35 bucks and get the Developer Edition. It has all the tools you need.
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest books:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) and
Hitchhiker's Guide to SQL Server 2005 Compact Edition
------
"Monica" <Monica@.discussions.microsoft.com> wrote in message
news:42F8C3FE-6410-4083-A3EF-453895ABA12C@.microsoft.com...
>I have the following situation:
> Database1 on my sql server with the following path: C:\DBs
> \Database1.mdf, etc... I made a backup of this database. Now I need
> to restore this backup on a different pc into the following: Database2
> with the following path C:\Customers\DBS\Database2.mdf, etc... I have
> MSDE install on the pc so I dont have the enterprise manager that will
> allow me to restore a db and rename the path and file name. What is
> the script that I need to run using the osql command?
> Thanks
|||=?Utf-8?B?TW9uaWNh?= <Monica@.discussions.microsoft.com> wrote in
news:42F8C3FE-6410-4083-A3EF-453895ABA12C@.microsoft.com:
> I have the following situation:
> Database1 on my sql server with the following path: C:\DBs
> \Database1.mdf, etc... I made a backup of this database. Now I need
> to restore this backup on a different pc into the following: Database2
> with the following path C:\Customers\DBS\Database2.mdf, etc... I have
> MSDE install on the pc so I dont have the enterprise manager that will
> allow me to restore a db and rename the path and file name. What is
> the script that I need to run using the osql command?
> Thanks
something like
RESTORE DATABASE [Database2]
FROM DISK='full_path_of_backup_file'
WITH MOVE 'Database1' TO 'C:\Customers\DBS\Database2.mdf',
MOVE 'Database1_log' TO 'C:\Customers\DBS\Database2_log.ldf'
See BOL for the gory details
|||Thanks...
I tried that but now I get this:
Server: Msg 3234, Level 16, State 2, Line 1
Logical file 'Database1' is not part of database 'Database2'. Use RESTORE
FILELISTONLY to list the logical file names.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
|||=?Utf-8?B?TW9uaWNh?= <Monica@.discussions.microsoft.com> wrote in
news:6C6F4DE3-3AE6-4753-AB7D-4CB063CDA122@.microsoft.com:
> Thanks...
> I tried that but now I get this:
> Server: Msg 3234, Level 16, State 2, Line 1
> Logical file 'Database1' is not part of database 'Database2'. Use
> RESTORE FILELISTONLY to list the logical file names.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
Sorry, it would appear that the 'logical name' of your database is NOT
Database1. To find what the logical name is, do what the message says by
running the query
RESTORE FILELISTONLY
FROM DISK='full_path_of_backup_file'
Then, in what I wrote before
RESTORE DATABASE [Database2]
FROM DISK='full_path_of_backup_file'
WITH MOVE 'Database1' TO 'C:\Customers\DBS\Database2.mdf',
MOVE 'Database1_log' TO 'C:\Customers\DBS\Database2_log.ldf'
change MOVE 'Database1' to be MOVE 'logicalname1' and
MOVE 'Database1_log' to be MOVE 'logicalname2' (probably MOVE
'logicalname1_log') for whatever logicalnames are shown by RESTORE
FILELISTONLY
FWIW I have just run the following renaming-restore successfully for
myself
RESTORE DATABASE [Database2]
FROM DISK='C:\Documents and Settings\chris\My Documents\Databases
\Cambridge-41a-Backup-2005-06-03'
WITH MOVE 'Cambridge-41' TO 'C:\Documents and Settings\chris\My
Documents\Databases\Database2.mdf',
MOVE 'Cambridge-41_log' TO 'C:\Documents and Settings\chris\My
Documents\Databases\Database2_log.ldf'
(cut-and-pasted) so it's just a matter of making the appropriate changes
(making sure that the commas, quotes, etc are in the correct places).
HTH
Subscribe to:
Posts (Atom)