Archive: Execute SQL Server script with parameters


Execute SQL Server script with parameters
Hello,

I am new to NSIS and I came across a problem that doesn't seem to have been addressed yet, so I am posting it here after spending quite some time searching for my answer all over the net to no avail.

I need to execute a SQL Server script which takes 2 parameters (user input from installer's UI during installation) during the setup of my application.

Is it possible with NSIS? If so, can anybody give me a few clues on how to do it?

Thanks a lot in advance!


Probably the best thing would be the MSSQL OLEDB plugin.

You could also use MS's sqlcmd.exe and run it using nsExec. (If you are using SQL 2000, then there's also osql.exe command, although it can be slower than sqlcmd.exe)