dbTalk Databases Forums  

DTS and binary files

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS and binary files in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
brienc@gmail.com
 
Posts: n/a

Default DTS and binary files - 10-21-2004 , 02:17 PM






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!


Reply With Quote
  #2  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: DTS and binary files - 10-22-2004 , 07:18 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

<brienc (AT) gmail (DOT) com> wrote

Quote:
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!




Reply With Quote
  #3  
Old   
brienc@gmail.com
 
Posts: n/a

Default Re: DTS and binary files - 10-25-2004 , 06:19 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


Reply With Quote
  #4  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: DTS and binary files - 10-25-2004 , 07:41 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

<brienc (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #5  
Old   
brienc@gmail.com
 
Posts: n/a

Default Re: DTS and binary files - 10-25-2004 , 09:48 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)


Reply With Quote
  #6  
Old   
Ilya Margolin
 
Posts: n/a

Default Re: DTS and binary files - 10-25-2004 , 04:12 PM



Brien,

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

Ilya
<brienc (AT) gmail (DOT) com> wrote

Quote:
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)




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.