|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SQLDMO:To Change Database file Location path of DBBackup file ( VCI am creating a tool in VC7.0 for database restoration I am facing a problem while working with sql dmo objects i need to restore a database, which has database location as "C:\Program Files\Microsoft SQL Server\MSSQL\Data\Sample.mdf" to new instance of SQlserver called as NEWINSTANCE. If i try to restore the database file with out modifying the location path then my restoration process is failing since "C:\Program Files\Microsoft SQL Server\MSSQL\Data\" does not exist in the new machine. So i need to change the database location file path as given below "C:\Program Files\Microsoft SQL Server\MSSQL$NEWINSTANCE\Data\Sample.mdf" but i am not able to figure out how to achive it can any one please help me out to solve the problem waiting in message loop for response message With Regards Hi
I don't have the SQL Server 2000 BOL on my machine at the moment, but the T-SQL command will be "RESTORE DATABASE .......WITH MOVE" AFAIK, there is an equivalent in DMO. Regards -------------------------------- Mike Epprecht, Microsoft SQL Server MVP Zurich, Switzerland IM: m***@epprecht.net MVP Program: http://www.microsoft.com/mvp Blog: http://www.msmvps.com/epprecht/ Show quote "Inthi" <In***@discussions.microsoft.com> wrote in message news:15A98C63-85A0-467A-A6A0-9D5EAEBB53FC@microsoft.com... > Dear all > I am creating a tool in VC7.0 for database restoration > I am facing a problem while working with sql dmo objects i need to restore > a database, which has database location as "C:\Program Files\Microsoft SQL > Server\MSSQL\Data\Sample.mdf" to new instance of SQlserver called as > NEWINSTANCE. > > If i try to restore the database file with out modifying the location path > then my restoration process is failing since "C:\Program Files\Microsoft > SQL > Server\MSSQL\Data\" does not exist in the new machine. > > So i need to change the database location file path as given below > "C:\Program Files\Microsoft SQL Server\MSSQL$NEWINSTANCE\Data\Sample.mdf" > but i am not able to figure out how to achive it > can any one please help me out to solve the problem > > waiting in message loop for response message > > With Regards > > Please do not multi-post. I answered this in .programming.
-- Show quoteTom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada t**@cips.ca www.pinpub.com "Inthi" <In***@discussions.microsoft.com> wrote in message news:15A98C63-85A0-467A-A6A0-9D5EAEBB53FC@microsoft.com... > Dear all > I am creating a tool in VC7.0 for database restoration > I am facing a problem while working with sql dmo objects i need to restore > a database, which has database location as "C:\Program Files\Microsoft SQL > Server\MSSQL\Data\Sample.mdf" to new instance of SQlserver called as > NEWINSTANCE. > > If i try to restore the database file with out modifying the location path > then my restoration process is failing since "C:\Program Files\Microsoft > SQL > Server\MSSQL\Data\" does not exist in the new machine. > > So i need to change the database location file path as given below > "C:\Program Files\Microsoft SQL Server\MSSQL$NEWINSTANCE\Data\Sample.mdf" > but i am not able to figure out how to achive it > can any one please help me out to solve the problem > > waiting in message loop for response message > > With Regards > > |
|||||||||||||||||||||||