Page 1 of 1

Write SQL results to s file

Posted: Fri May 09, 2008 2:57 pm
by Roostar2004
Is there a way to write the results of an SQL query run in installaware to a file?

Posted: Mon May 12, 2008 2:35 pm
by mehran
Installaware doesn't supprot this directly. You have to use bcp.exe tool which exists in binn directory of SQL Server (if you are using SQL Server). you should use "Run Program" and call bcp.exe, and provide commands for it. (see microsoft website for details about this command)
Mehran Balaei

Posted: Mon May 12, 2008 2:43 pm
by jimo
bcp is a bulk copying utility. I believe what you want is to run a sql scipt and log the out put. The way I accomplish is to use "Run Program" but I call sqlcmd or osql. I create the script file on disk and run sqlcmd or osql against it. You can package the cript file in your support files section or in the IDE they are called "Creatives".

Posted: Wed May 21, 2008 11:06 am
by Roostar2004
We are currently using a batch file to run our SQL commands but we have to restart after SQL server is installed or the batch file will not run. We do not have to force out users to restart if we use the build in SQL runner in Installaware. The only problem with this is that we would like to have an output log of the script process so we can use it to debug any issues that they might have.

We create a named instance of SQL server rather then using the default.

Posted: Wed May 21, 2008 1:35 pm
by jimo
I would double check, but I believe you can just start the service using "Control Service".

Posted: Thu May 22, 2008 6:32 pm
by LarsS
Assuming that you are calling one of the SQL server tools in your bat file I think the problem is that the path to SQL servers Binn folder is not in your "environment variables" yet when you call your bat file.

Try using "Run program as" and supply the "stuff" missing.

Posted: Tue Jun 10, 2008 8:15 am
by Roostar2004
Sorry I have not gotten back in awhile but the problem is that the path does not get writen until installaware is done for some reason.