Gujju Gujju 21 3 3 bronze badges. The last pointer just echoes what was set using the spool command. It doesn't give the full absolute path which is what I want.
Is there any workaround for this? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Laurent K Laurent K 3, 3 3 gold badges 28 28 silver badges 35 35 bronze badges. Add a comment. Active Oldest Votes. I'm a newbie SQLDeveloper user, so if there is a better way please let me know.
Improve this answer. Mike G Mike G 4, 2 2 gold badges 26 26 silver badges 31 31 bronze badges. Note that it needs a recent enough version. Version 3. It needs two executions. If your request takes hours you are screwed — Erwan C. This question is really old, but posting this so it might help someone with a similar issue. I need csv output but its printing in some other format which is not much readable — Rajesh Goel.
How can I do it? The "PowerShell" way to do this is to use the Out-File cmdlet, adding this line at the end:. You should also consider setting the file encoding explicitly if you need it to be UTF8 for example :.
How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. IO and Data. IO is used to write information to a file in this scenario a txt file and Data. The second line is to specify the connection information SQL Server name, database name and Authentication method :. The try structure is used to handle exceptions. The line with "while reader.
Read " is used to read row by row the results of the SQL Query. This is used to handle errors. Show will show the error and Dts. TaskResult will show a failure red color if it fails. This code is used when an exception error is generate by the package. If the presentation is important, Reporting Services is the best option. Press Preview and in the Save icon, select CSV comma delimited to save the file with the csv extension:. It is a very fast option.
Use it if you have millions of rows and you need to use the command line or if it is easy to call the command line from your program or script. The following example uses bcp to export the query results to a file named bcp. There are many other ways to export results.
However, these options will inspire you to use other ones.
0コメント