PDA

View Full Version : Execute an SQL script on the remote server.



shkoda911
03-09-2005, 02:06 PM
Hello,

in my script OnFirstUIAfter I generate an SQL Script that needs to be executed on the remote SQL server. How could it be done?

thanks

Annaraj
03-10-2005, 01:52 AM
Hi,

This is what am doing...



szAppln="isql.exe";
szParameters=" -S "+szDbServerName+" -U "+szUserName+" -P "+szPassword+" -d "+szDBName+" -i DBSqlScripts.sql";

LaunchAppAndWait(szAppln,szParameters,LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);

Note: But to execute this you need to have the SQL Server client utility installed in the installing machine..i mean the isql.exe, you can also use osql.exe

Best of Luck,

- Anna