Generating a text file from a stored procedure, without cmdshell

  • I'd like to generate a .txt file from a simple select statement - but it needs to  happen when a user runs a report.  I got it working with xp_cmdshell and osql, but would rather do it another way.   Anyone have anything I'm missing?

    Thanks for the help

    Sam

  • When you say report, what do you mean. Are you using Reporting Services or some other reporting tool or that they just run the SP and if so from what interface.

    Query Analyzer can produce results to a file if they are using QA but the user has to configure.

  • Yes, reporting services will be used - the customer needs to look at the report which uses a stored proc and have a .txt file written to a server share where it will be imported into another system.

  • I've put the option foward of having them save it manually to the share - where appworx(a job scheduler tool you may be familiar with) will be polling to pick it up and move it to an oracle db.  They are wanting to automate to the fullest extent.

  • Reporting Services has the ability to export to Text file including on schedule to a share of your choosing. You might want to consider that option. Or have them view the report and export to text file from the Reporting Services viewer.

  • Yes, that's what I was referring to in the previous post - but they don't want to do that. This is for year end closing, so they want to be able to run it many times in one day.

  • This is where they will tweak their numbers and then want to overlay what they've done with the latest and greatest? or will they want to keep their various versions? It makes a difference in what you try to accomplish. (And, unless they say that they want to keep their various versions, I would be inclined NOT to believe them.)

  • Yep you are kinda tied to no options if you cannot use the tool as it is meant to be used.

  • "This is where they will tweak their numbers and then want to overlay what they've done with the latest and greatest? or will they want to keep their various versions? It makes a difference in what you try to accomplish. (And, unless they say that they want to keep their various versions, I would be inclined NOT to believe them.)"

    yes, they tweak and massage various things which I have no knowledge of - and preview the output in reporting services.  The file can be loaded repeatedly - new changes will overwrite. so they can deposit files as many times as they want to.  You say you wouldn't believe them in this case?  Please explain.

Viewing 9 posts - 1 through 8 (of 8 total)

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