Write SQL results to s file

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

Write SQL results to s file

Postby Roostar2004 » Fri May 09, 2008 2:57 pm

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

Postby mehran » Mon May 12, 2008 2:35 pm

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:

Postby jimo » Mon May 12, 2008 2:43 pm

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

Postby Roostar2004 » Wed May 21, 2008 11:06 am

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:

Postby jimo » Wed May 21, 2008 1:35 pm

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

Postby LarsS » Thu May 22, 2008 6:32 pm

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

Postby Roostar2004 » Tue Jun 10, 2008 8:15 am

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.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 58 guests