Home All Groups Group Topic Archive Search About

Results from SP as CSV file (BCP or SQLDMO)

Author
28 Apr 2006 9:49 PM
yitzak
Hi

I have an app that executes a stored procs and writes out the data to a
file. Currently uses ADO recordset and goes through each record.

This is slow.

I would like to use bulkcopy - however have the problem that the app
resides on a client machine - so will not have SQL server installed.
That means I can rule out using the BCP utility unless I do something
messy like create a share on the client machine visible from the
Server.

Is it possible to copy the BCP utility (exe only) to a client machine -
so they can run that?

Tried with SQLDMO but only tables and views have the exportdata method.
Its NOT possible for me to create temp tables and insert the data (from
Stored proc) in there first then export.

Any ideas?

Thanks

Author
29 Apr 2006 9:14 AM
Simon Sabin
Hello yitzak,

Copying data out using ADO should be quick. The key is to reduce anything
in your loop to the minimum.

Can you post your code for copying out to a file

Show quote
> Hi
>
> I have an app that executes a stored procs and writes out the data to
> a file. Currently uses ADO recordset and goes through each record.
>
> This is slow.
>
> I would like to use bulkcopy - however have the problem that the app
> resides on a client machine - so will not have SQL server installed.
> That means I can rule out using the BCP utility unless I do something
> messy like create a share on the client machine visible from the
> Server.
>
> Is it possible to copy the BCP utility (exe only) to a client machine
> - so they can run that?
>
> Tried with SQLDMO but only tables and views have the exportdata
> method. Its NOT possible for me to create temp tables and insert the
> data (from Stored proc) in there first then export.
>
> Any ideas?
>
> Thanks
>
Author
5 May 2006 10:34 PM
Farmer
use OSQL , from any cleint,  specify your sp as a query and use output to
file option.


Show quote
"Simon Sabin" <SimonSabin@nospam.nospam> wrote in message
news:89dca5dba9788c8398cc6ff8d00@msnews.microsoft.com...
> Hello yitzak,
>
> Copying data out using ADO should be quick. The key is to reduce anything
> in your loop to the minimum.
>
> Can you post your code for copying out to a file
>
>> Hi
>>
>> I have an app that executes a stored procs and writes out the data to
>> a file. Currently uses ADO recordset and goes through each record.
>>
>> This is slow.
>>
>> I would like to use bulkcopy - however have the problem that the app
>> resides on a client machine - so will not have SQL server installed.
>> That means I can rule out using the BCP utility unless I do something
>> messy like create a share on the client machine visible from the
>> Server.
>>
>> Is it possible to copy the BCP utility (exe only) to a client machine
>> - so they can run that?
>>
>> Tried with SQLDMO but only tables and views have the exportdata
>> method. Its NOT possible for me to create temp tables and insert the
>> data (from Stored proc) in there first then export.
>>
>> Any ideas?
>>
>> Thanks
>>
>
>
Author
8 May 2006 11:13 PM
yitzak
Thanks Farmer  - how will osql be on a client machine. No MSSQL
specific stuff is installed just MDAC..

AddThis Social Bookmark Button