Connecting Tech Pros Worldwide Help | Site Map

Exporting data

  #1  
Old November 7th, 2008, 03:05 PM
GerdBrix@gmail.com
Guest
 
Posts: n/a
Hi, I have a few legacy systems to which I need to export data from
SQL server 2000.
The export should be done every one or two hours, so there's much time
for little data ;-)

My first idea to do this was using a batch file. I found bcp.exe,
which could work - however, I have text data in the table, and this is
not quoted by bcp.exe. Parsing the resulting data is, to say the
least, difficult...

Can someone please suggest a way to do this task?

Thanks,
Gerd
  #2  
Old November 7th, 2008, 07:25 PM
patrick61z@yahoo.com
Guest
 
Posts: n/a

re: Exporting data


On Nov 7, 10:04 am, GerdB...@gmail.com wrote:
Quote:
Hi, I have a few legacy systems to which I need to export data from
SQL server 2000.
The export should be done every one or two hours, so there's much time
for little data ;-)
>
My first idea to do this was using a batch file. I found bcp.exe,
which could work - however, I have text data in the table, and this is
not quoted by bcp.exe. Parsing the resulting data is, to say the
least, difficult...
>
Can someone please suggest a way to do this task?
>
Thanks,
Gerd

I use bcp, and point it at a view on the server (sql2005), and this
view on the server puts multiple fields with delimiters together into
one record / field, and this lets me choose my output delimiter.

like

create view EXPORT_VIEW as select NAME + '|' + ADDRESS + '|' + CITY +
'|' + STATE from CUSTOMER_TABLE

and then bcp that. This lets me use the vertical pipe as a delimiter.

At least on 2005, bcp has many options and some of these go into a
spec file, but I've been happy just doing the field delimiters in sql.
  #3  
Old November 11th, 2008, 08:25 AM
Gerd Brix
Guest
 
Posts: n/a

re: Exporting data


On 7 Nov., 20:22, patrick...@yahoo.com wrote:
Quote:
On Nov 7, 10:04 am, GerdB...@gmail.com wrote:
>
[...]
Quote:
>
like
>
create view EXPORT_VIEW as select NAME + '|' + ADDRESS + '|' + CITY +
'|' + STATE from CUSTOMER_TABLE
>
and then bcp that. This lets me use the vertical pipe as a delimiter.
>
[...]

Great! That's exactly what I needed... Thanks!

-gerd

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Exporting Data to Word Mux answers 2 July 25th, 2006 03:35 PM
exporting data from ms-access to excel worksheet using ASP. sridevi answers 3 November 22nd, 2005 08:40 PM
Exporting data from (All columns in data grid EXCEPT THE 1st) to E pmud answers 2 November 19th, 2005 02:45 AM
exporting data from ms-access to excel worksheet using ASP. sridevi answers 3 July 22nd, 2005 03:34 AM
exporting data from ms-access to excel worksheet using ASP. sridevi answers 3 July 22nd, 2005 12:13 AM