Link to home
Start Free TrialLog in
Avatar of davidcahan
davidcahanFlag for United States of America

asked on

Where does BCP QueryOut Command Save File To

Dumb Question.  One i think i already know the answer to.  I have a process that is kicked off via a web form on my web server.  This process runs a stored procedure that executes a BCP command and writes a file via the QueryOut command.  The dumb question is:  where is the file being saved to, the web server or the database server?  I think the answer is the database server.  And of course when i created this process i was working off a machine that has both the web server and database server on the same machine.    I totally spaced on the fact that the webserver and DB server split onto 2 different machines once the app migrates to production.

Anyone have a good workaround for this that would allow my web box to access the file?  The user is going to be presented a link after the process finishes that is supposed to allow them to open the file and view the information in it.
Avatar of rickchild
rickchild
Flag of United Kingdom of Great Britain and Northern Ireland image

It could be outputting to either, depending on syntax in the BCP or the format file.

By default it would be outputting to the database server if no full path is specified.
ASKER CERTIFIED SOLUTION
Avatar of rickchild
rickchild
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
bcp is a client utility that will output to the client machine that it runs on.  If it ran on your web server specifying C:\Temp, the file would go to the web server.
Avatar of davidcahan

ASKER

that worked like a charm.  thanks