views:

30

answers:

1

The project I'm working uses SMO to restore the needed databases as part of the application installer. The problem is, on a machine that has never had the application installed.

From the event logs, it seems like the database can't be restored because it doesn't exist in the instance. (Due to the fresh install)

Can I use SMO to restore the database to an instance where it doesn't already exist? Is there a best practice for installing databases this way?

+1  A: 

Have you thought about maybe just using smo to attach the database on new installation, assuming you already have the .mdf/.ldfs and related paths?

Glutz