all groups > sql server dts > october 2004 >
You're in the

sql server dts

group:

DTS and binary files


DTS and binary files brienc NO[at]SPAM gmail.com
10/21/2004 12:17:14 PM
sql server dts:
I have seen this question a few times in the past, but there has never
been a good answer. I have a very large binary file that I want to
read into a SQL Server table. Each record in the file is a fixed size.
It seems like I should be able to use DTS to do this, or at the worst
write some VB code to do it. Does anyone have a good solution?
Thanks in advance!
Re: DTS and binary files Ilya Margolin
10/22/2004 8:18:31 AM
Is it a binary and you want to save it as a blob or is it a large text file
and you want to break it up on records?

Ilya

[quoted text, click to view]

Re: DTS and binary files brienc NO[at]SPAM gmail.com
10/25/2004 4:19:20 AM
It is a large binary file with many records. Each record has several
fields of differing length. I want to break up the file and read it
into SQL Server so that each record is a row in a table and each field
is a column in the table. Thanks!
Brien
Re: DTS and binary files brienc NO[at]SPAM gmail.com
10/25/2004 7:48:14 AM
The fields are fixed length, but are not text. BCP and DTS seem to
only work with text formats, not binary. Here's an example:

Let's say that my data consists of a list of integers, one byte each.
DTS could handle the data if it looked like this:
(ASCII)
1
2
3
4

My data looks like this:
(binary)
00000001000000100000001100000100

It seems like there should be some way to tell SQL server to read in
one byte at a time and interpret it as an int. (my data is much more
complicated, but this is the general idea)
Re: DTS and binary files Ilya Margolin
10/25/2004 8:41:49 AM
Brien,

Is it a fixed length or a delimited file? In either case you can use
BCP/Bulk Insert SQL/Bulk Insert Task or Data Transformation Task. The first
is going to be faster.

Ilya

[quoted text, click to view]

Re: DTS and binary files Ilya Margolin
10/25/2004 5:12:00 PM
Brien,

Can you give me a file with few row of you data and how should it be
interpreted?

Ilya
[quoted text, click to view]

AddThis Social Bookmark Button