473,663 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting data

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
Nov 7 '08 #1
2 1942
On Nov 7, 10:04 am, GerdB...@gmail. com wrote:
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.
Nov 7 '08 #2
On 7 Nov., 20:22, patrick...@yaho o.com wrote:
On Nov 7, 10:04 am, GerdB...@gmail. com wrote:
[...]
>
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

Nov 11 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1973
by: Angel Cat | last post by:
I'm exporting a large file from a large Production database (SQL). Users are currently updating and inserting new records. Does the export take a snapshot of the data when it starts ? or will it freeze the database so all udpates/inserts happen after the export completes? Also, how do I get the delta of data that wasn't exported, if I want to get the difference the next day?
3
9238
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
4
3942
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear" TEXT field that contains data such as 2000/01, 2001/02, etc. If I export a Query with this kind of data to Excel, it gives me the text value of this field; however, when I export a Report bound to this TEXT field, Excel gives me the values 36526,...
2
2301
by: pmud | last post by:
Hi, I am exporting data from an EDITABLE DATA GRID EXCEL. But the 1st column in data grid is Edit Column. I want to display all columns in Excel except for the Edit column. The following code which I am using allows exporting only from text data from data grid & not from Edit columns which are link buttons. How to leave this column while displaying data from data grid in Excel?
2
2402
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform exporting ALL data from the datagrid control. Exporting data works fine when I show all data on the datagrid control. I'd like to shows only 30 records on the datagrid control instead of ALL data using page navigation, and perform exporting...
2
3170
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
2
2865
by: Mux | last post by:
I am facing the following problem while exporting data to Word. The current implementation is as described below: I have a JSP file which has a link that enables you to export the data to Word. Clicking on the link invokes a javascript function: function showRTF() { var newWin = window.open("", "newWin","width=900,height=800%,scrollbars=yes,menubar=yes,resizable=yes,too
6
8202
by: sara | last post by:
I have what I think is a little strange...I have to get data from our payroll system into a specific format (fixed record length) as a .txt or .prn file only to upload to our 401k custodian. I can get the data into Access (from Payroll) and write a query with all the fields (inserting fields with spaces, as needed), but I can't figure out how to get it to export to a .txt file - without the field name header row. I don't really ...
0
1708
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
hi, I trying to export data display on a gridview that supports any language (like chinese, japanese, thai, french) shown here is chinese only. There is no problem exporting english language data, problem starts exporting non-english data using approach shown below, the data is retrieve in database in an xml format. Is there a simple way to be able to make this work? Response.ContentEncoding = System.Text.Encoding.UTF8;
2
1836
by: billelev | last post by:
Hi there, My question does not concern the exporting of data to CSV so much as the format of the exported data. The data to be exported consists of a time series of prices for a number of assets. I can easily bring up a query of the data I want to export in the following way: SELECT Date, Asset, AssetPrices FROM tblPrices; returning:
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.