0

Hi guys I need to make a query that exports a csv file. Sadly the select * into file is not working.

mohabbati
  • 1,162
  • 1
  • 13
  • 31
  • 2
    use bcp command. – Dean Savović Nov 13 '18 at 12:08
  • 2
    Please refer https://dba.stackexchange.com/questions/23566/writing-select-result-to-a-csv-file – Sanal Sunny Nov 13 '18 at 12:08
  • Can't use BCP due to the fact that it is external utility, not built in the language. – Adam Dominiak Nov 13 '18 at 12:30
  • what's wrong with using external utility ? – Squirrel Nov 13 '18 at 12:31
  • What environment are you running the query in? SQL Server Management Studio? A client application that you've written yourself? Where do you want the output to be written, the server or somewhere local? The normal use-case is that you want the results to be written locally to whatever process is submitting the query. In which case ***THAT*** process should take the result set and write it to a file itself *(SQL won't do that)*. – MatBailie Nov 13 '18 at 12:33
  • When asking, it is better to also include the exact code you have tried and why it does not work as well as your desired output. – Mark Schultheiss Nov 13 '18 at 12:34
  • Automation software I use won't let me use it. https://imgur.com/a/PmwCouH Here is the list of what I can use – Adam Dominiak Nov 13 '18 at 12:35
  • 1
    @AdamDominiak - edit your question with the additional information (not an image or picture link) https://stackoverflow.com/help/mcve – Mark Schultheiss Nov 13 '18 at 12:36
  • @MarkSchultheiss like I said there is no additional info. When I use the BCP command it won't let me pass through. Command construction is like so: $DBExecute("NAME_OF_CONNECTION_WITH_DB","STANDARD SQL QUERY") I just can't use bcp. Any other way? – Adam Dominiak Nov 13 '18 at 12:45
  • But you added a link to a picture in a comment, extract that, add your information to your question that you have in comments. ALSO as it stands this seems like a duplicate: https://stackoverflow.com/q/425379/125981 If not, add that link in your question and why THAT does not work (as well as similar answers) - see, that is what is meant by additional information...As it stands, your question is likely to get closed as "unclear", "too broad" or a duplicate of some other question like that one. Comments are NOT part of your question. – Mark Schultheiss Nov 13 '18 at 12:47

0 Answers0