I have a project which needs to create an SQL Database probably on a remote SQL Server. I do this by executing a few SQL scripts. (.sql file)
Currently I do this using the Microsoft.SqlServer.Management.Sm dll (SQL Server management Objects) but I have a problem when it comes to deploying the application.
I am using the Visual Studio 2008 installer project and there is no facility that I can see to add SMO as a dependancy and get the installer to download the correct version - there is a 32 and 64 bit version of SMO.
My question is therefore broken into 2 parts.
1> Is it possible to execute a script other than using SMO in the case where Microsoft SQL Server is NOT installed on the local PC? My current code is:-
SqlConnection connection = new SqlConnection(_dbConnection.ConnectionString);
Server server = new Server(new ServerConnection(connection));
2> If this is not possible, how can I get SMO to be included in my installation and install the correct version using the Visual Studio installer project?
Thanks for any help - this is quite urgent!!