dbTalk Databases Forums  

Question on Activex script in DTS

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


Discuss Question on Activex script in DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Blasting Cap
 
Posts: n/a

Default Question on Activex script in DTS - 06-04-2008 , 03:26 PM






I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

It's causing a problem when I try to load them into a table though. It
doesn't set it to spaces (which I am looking for later on to edit any
unfilled field) but with something else that I can't recognize, at least
by any means from within the Activex code available in SQL's DTS.

When I use Textpad to open the file, and try to display the field in
question, I get:

NUL(^@=0=0x0)

I figured checking

if DTSSource("col001") = NULL then
DTSDestination("Field1") = ""
else
DTSDestination("Field1") = DTSSource("col001")
end if

would take care of it, but it hasn't.

Anyone know what I've got to look for in order to edit it in the activex
script in DTS?

Any help appreciated.

Thanks

BC

Reply With Quote
  #2  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM






On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #3  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #4  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #5  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #6  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #7  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #8  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #9  
Old   
Payson
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-04-2008 , 04:14 PM



On Jun 4, 4:26*pm, Blasting Cap <goo... (AT) christian (DOT) net> wrote:
Quote:
I'm trying to bring over a text file into a SQL table, and the data has
got what appears to be low values in a field on it.

One way is to replace all occurances of char(0) with ' '. I'm pretty
sure vbscript has a replace function - or you can do it in sql like
this:

DECLARE@x varchar(10)

SET @x = 0x00000000000000000000

SELECT REPLACE(@x, CHAR(0), ' ')

HTH

Payson




Reply With Quote
  #10  
Old   
JussiJ
 
Posts: n/a

Default Re: Question on Activex script in DTS - 06-09-2008 , 09:21 PM



On Jun 5, 7:14*am, Payson <payso... (AT) hotmail (DOT) com> wrote:

Quote:
One way is to replace all occurances of char(0) with ' '. *I'm
pretty sure vbscript has a replace function - or you can do it
in sql ...
FWIW if you open such a file in the Zeus IDE it will convert
all binary characters into spaces and tells you that it has
done so:

http://www.zeusedit.com

The converted file is marked as read only so if you want to keep
the changes then you just use the save as menu option.

Jussi Jumppanen
Author: Zeus for Windows IDE



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.