Re: export to a text file

Re: export to a text file

 

  


For lack of a better way to do it, how about if you use a global temp table (##tableA) and then do an xp_cmdshell call to bcp to get it out. I tried a sample but did a call to osql and it found the global temp tale.

Personally, I'd like to see a more eloquent way but this will work in a pinch.

. . .Tom

On 09/24/2002 12:24:01 PM Shelly Wu wrote:
> Hi everybody,
>
> I have a store procedure that is doing all manipulations that I have to
> do.In this store procedure I create a temp table (#table A) and insert all
> records to this temp table,then doing all manipulation on this temp
> table.When the data is ready or finalized,I need to export to a text file
> within this SP and then check the result. I don't have CREATE permission on
> the database and my query is too complicated.so creating a temp table will
> simplify my procedure.
>
> Is anyone have idea how to export data from a temp table in one SP to a text
> file in OS level?
>
> BCP just can do permanant table and furthmore it is the MS-DOS command
> line.It can't be held in a store procedure.
>
>
> thanks
>
> Shelly
>
>



-----------------------------------------------------------------
Visit our Internet site at http://www.reuters.com

Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.
MS Sql Server LazyDBA home page