Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Unanswered: Dumping the SQL result

    Hi, is there a software that can dump the SQL result into a file or to another database? I am using the MSSQL Server and I am accessing it remotely. Is there a program where I can issue an SQL statement and then I can dump the result into a file (in SQL inserts or just plain CSV).

    Is there a free version?

    Thanks!

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    if you are using thr qery analyzer go to query-->results to file
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by patch_32
    Hi, is there a software that can dump the SQL result into a file or to another database? I am using the MSSQL Server and I am accessing it remotely. Is there a program where I can issue an SQL statement and then I can dump the result into a file (in SQL inserts or just plain CSV).

    Is there a free version?

    Thanks!
    You can try this -
    From command prompt:
    osql.exe -S YourServerName -U sa -P secretcode -Q "EXEC sp_who2" -o "E:\output.txt"

    From T-SQL:
    EXEC master..xp_cmdshell 'osql.exe -S YourServerName -U sa -P secretcode -Q "EXEC sp_who2" -o "E:\output.txt"'
    Success is the ability to go from one failure to another with no loss of enthusiasm.
    - Sir Winston Churchill
    Joydeep

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •