Export to Text, CSV, or Excel through web app

  • Hi all, I'm looking for a solution where end users can click a web button to download the results of query (sp or view). I know I could right click database in SSMS and export to various file formats, but I'm looking for something I could provide users without SSMS installed. The closest I found is to create ODBC connection in Excel and pull from a view, but recently I'm having issues where Excel is showing something different than what's in the database. Any help or direction will be appreciated. Thanks.

  • Have you tried using SSRS?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • We do not have SSRS installed. It will be on next year's budget.

  • aliens218 (12/11/2014)


    Hi all, I'm looking for a solution where end users can click a web button to download the results of query (sp or view). I know I could right click database in SSMS and export to various file formats, but I'm looking for something I could provide users without SSMS installed. The closest I found is to create ODBC connection in Excel and pull from a view, but recently I'm having issues where Excel is showing something different than what's in the database. Any help or direction will be appreciated. Thanks.

    You should find out why Excel is showing something different than in the database. If it's not a formatting issue, then it's likely something wrong in the query.

    Don't re-invent the wheel just because you have a flat tire.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Yes definitely a query issue. Make sure the query is updated. Unless the excel spreadsheet is shared, everybody's queries will have to be updated.

  • Alvin, Josh,

    The only thing I could think wrong about the query is that its nested (one view pulling from another view with multiple joins etc). I have ran the final view in SQL, then at the same time refreshed the Excel file on two separate computers, but Excel is showing different results. When I delete the rows and refresh the connection file again, some of the columns previously populated are refreshing as blank. Its not just formatting issue, it looks like more like Excel wasn't able to refresh the file quick enough, so it kept some of the columns in memory while refreshing just the others. Unfortunately since the data looks right when refreshed in Excel, its hard to validate the numbers until we come across something we know is wrong for sure.

    I'll keep troubleshooting with restructuring the query, to make it less complicated. I'm also looking for alternate options where the end-users can download the results into a text file (and then import into Excel).

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply