Archive: how to install database for a remote server?


how to install database for a remote server?
now I install database (sqlserver) use
nsexec to exec "osql -i foobar.sql" in local server.

how to install database for a remote server usually?
thanks


Have you tried the MSSQL plug-in? It might be able to do this.

http://nsis.sourceforge.net/MSSQL_OLEDB_plug-in


thanks


I think this plugin can not resolve my case .

create a database,sqlserver script must set filename="c:\foo\bar.mdf",such as

CREATE DATABASE [foobar] ON (NAME = N'foobar_Data', FILENAME = N'c:\foo\bar_Data.MDF' , SIZE = 16, FILEGROWTH = 10%) LOG ON (NAME = N'foobar_Log', FILENAME = N'c:\foo\bar_Log.LDF' , SIZE = 6, FILEGROWTH = 10%)

COLLATE Chinese_PRC_CI_AS

GO

I usually use nsexec to exec "osql -i foobar.sql" in local server.

if install a remote server,I can not know whether remote server's c:\foo directory exists.

I know sqlserver has a default database storage directory,I think just install database to the default directory is ok.

any advice?


in local server,I can read registr to get sqlserver default database storage directory

if I can read remote registr, also can get it


Does MSSQL plugin work with remote servers...
Does MSSQL plugin work with remote servers?

I keep getting "Error initializing OLEDB Connection (Initialize)" when trying to contact a remote SQL server.

The same code works fine when contacting local SQL servers so I'm thinking I may be missing something with the remote call or it just plain isn't supported.

TIA,

lushdog


A local or a remote SQL connection are the same thing for the plugin. Are the required protocols configured on the client and on the server? (TCP/IP or named pipes)
For remote database creation you can use CREATE DATABASE [foobar] with no additional parameters. It will be created in the default directory as a copy of the model database.
If you want to know what is the default directory for sql data, you can use the sp_helpdb stored procedure passing master as parameter (the master database is always present in a MSSQL installation)