Home > Archive > MS SQL Server > October 2006 > Restore SQL Server to default SQL data directory









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Restore SQL Server to default SQL data directory
Gianluca Dho

2006-10-24, 6:33 pm

Hi,

I need to prepare an Installshield project that restore a database on
my target machine.

No problem with script

RESTORE DATABASE BIGStudio FROM DISK=MyDir\MyBackup.bak'
WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10, MOVE 'DB_dat' TO
'\Data\DB_Data.mdf',
MOVE 'DB__log' TO '\Data\DB_log.ldf'.

But in my target machine I can have SQL Server 2000, SQL Server 2005,
MSDE 2000...

I've tried to restore DB on my INSTALL dir but I receive an access
denied error. How can I restore my DB to the default SQL Server data
directory on my target machine?

Thank you

Gianluca Dho

Immy

2006-10-24, 6:33 pm

You may need to obtain this info dynamically?
Check out xp_instance_regread
Immy
"Gianluca Dho" <gianluca.dho@gmail.com> wrote in message
news:1159535209.992156.163070@b28g2000cwb.googlegroups.com...
> Hi,
>
> I need to prepare an Installshield project that restore a database on
> my target machine.
>
> No problem with script
>
> RESTORE DATABASE BIGStudio FROM DISK=MyDir\MyBackup.bak'
> WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10, MOVE 'DB_dat' TO
> '\Data\DB_Data.mdf',
> MOVE 'DB__log' TO '\Data\DB_log.ldf'.
>
> But in my target machine I can have SQL Server 2000, SQL Server 2005,
> MSDE 2000...
>
> I've tried to restore DB on my INSTALL dir but I receive an access
> denied error. How can I restore my DB to the default SQL Server data
> directory on my target machine?
>
> Thank you
>
> Gianluca Dho
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com