Write SQL results to s file

Got a problem you cannot solve? Try here.
Post Reply
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Write SQL results to s file

Post by Roostar2004 »

Is there a way to write the results of an SQL query run in installaware to a file?
mehran
Posts: 20
Joined: Tue Apr 22, 2008 12:17 pm
Location: Canada

Post 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
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post 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".
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Post 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.
jimo
Posts: 342
Joined: Fri Aug 19, 2005 10:59 am
Location: Atlanta, GA
Contact:

Post by jimo »

I would double check, but I believe you can just start the service using "Control Service".
Jim Oswell
Software Engineering Manager, Dental
Greenway Health, LLC
http://greenwaymedical.com
LarsS
Posts: 18
Joined: Mon Nov 19, 2007 8:03 pm

Post 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.
Roostar2004
Posts: 155
Joined: Mon Nov 12, 2007 11:59 am

Post 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.
Post Reply