dbTalk Databases Forums  

trim string transformation

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


Discuss trim string transformation in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
M D
 
Posts: n/a

Default trim string transformation - 04-19-2005 , 02:19 PM






I take it there is no way to have the import wizard default to a
transformation other than copy. Nor any way to replace the copy with
transformations with trim transformations in the resulting package other
than iterating through delete & new.

This designer is not all that friendly.

thx
md

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: trim string transformation - 04-19-2005 , 02:30 PM






You are unfortunately there is no setting that will do this for you and no easy way of doing it after the event either.

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"M D" <mardukes (AT) aol (DOT) com> wrote

Quote:
I take it there is no way to have the import wizard default to a
transformation other than copy. Nor any way to replace the copy with
transformations with trim transformations in the resulting package other
than iterating through delete & new.

This designer is not all that friendly.

thx
md

*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
  #3  
Old   
M D
 
Posts: n/a

Default Re: trim string transformation - 04-19-2005 , 03:23 PM



Is it possible to save as VB, replace in the source code:

Set oTransProps = oTransformation.TransformServerProperties

...with:

Set oTransProps = oTransformation.TransformServerProperties

oTransProps("TrimLeadingWhiteSpace") = True
oTransProps("TrimTrailingWhiteSpace") = True
oTransProps("TrimEmbeddedWhiteSpace") = False
oTransProps("UpperCaseString") = False
oTransProps("LowerCaseString") = False

...and shove it back in there? I.e. is there something else in the code
that needs changed that I am missing AND can I get the modified code
back in as a new version of the same package?

thx
md

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: trim string transformation - 04-19-2005 , 03:31 PM



Have a look at the differences in code by saving out to a VB module between the normal copy column transform and the trim transform.

You will then need to save it back yes.



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"M D" <mardukes (AT) aol (DOT) com> wrote

Quote:
Is it possible to save as VB, replace in the source code:

Set oTransProps = oTransformation.TransformServerProperties

..with:

Set oTransProps = oTransformation.TransformServerProperties

oTransProps("TrimLeadingWhiteSpace") = True
oTransProps("TrimTrailingWhiteSpace") = True
oTransProps("TrimEmbeddedWhiteSpace") = False
oTransProps("UpperCaseString") = False
oTransProps("LowerCaseString") = False

..and shove it back in there? I.e. is there something else in the code
that needs changed that I am missing AND can I get the modified code
back in as a new version of the same package?

thx
md

*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
  #5  
Old   
M D
 
Posts: n/a

Default Re: trim string transformation - 04-19-2005 , 06:28 PM



I saved two sub's to files and ran fc at a command prompt (I have edited
out those things that are simply differences in object names):

Comparing files with.txt and WITHOUT.TXT
*****
<the names of the subs>
*****

***** with.txt
Dim oColumn As DTS.Column
Set oTransformation =
oCustomTask3.Transformations.New("DTSPump.DataPump TransformTrimString")
oTransformation.Name = "DTSTransformation__1"
oTransformation.TransformFlags = 63
***** WITHOUT.TXT
Dim oColumn As DTS.Column
Set oTransformation =
oCustomTask3.Transformations.New("DTS.DataPumpTran sformCopy")
oTransformation.Name = "DTSTransformation__2"
oTransformation.TransformFlags = 63
*****

*****
<source column names>
*****

*****
<source Column Sizes>
*****

***** with.txt

Set oColumn = oTransformation.DestinationColumns.New("IDNumeral" , 1)
oColumn.Name = "IDNumeral"
oColumn.Ordinal = 1
oColumn.Flags = 120
oColumn.Size = 9
oColumn.DataType = 129
***** WITHOUT.TXT

Set oColumn = oTransformation.DestinationColumns.New("company", 1)
oColumn.Name = "company"
oColumn.Ordinal = 1
oColumn.Flags = 104
oColumn.Size = 30
oColumn.DataType = 129
*****

***** with.txt

oTransProps("TrimLeadingWhiteSpace") = True
oTransProps("TrimTrailingWhiteSpace") = True
oTransProps("TrimEmbeddedWhiteSpace") = False
oTransProps("UpperCaseString") = False
oTransProps("LowerCaseString") = False

***** WITHOUT.TXT


*****
************************************************** *********
The oTransformation As DTS.Transformation2 changes;
The destination oColumn As DTS.Column [Flags] attribute value is
different
Anyone know what that is?
And the afore mentioned additional TransformServerProperties settings
are added.

Now, how again does one put the crap back in the donkey?

thx
md

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: trim string transformation - 04-20-2005 , 12:35 AM



In the text you will find a section that asks you to either execute the package or to uncomment a line and put it somewhere.


--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"M D" <mardukes (AT) aol (DOT) com> wrote

Quote:
I saved two sub's to files and ran fc at a command prompt (I have edited
out those things that are simply differences in object names):

Comparing files with.txt and WITHOUT.TXT
*****
the names of the subs
*****

***** with.txt
Dim oColumn As DTS.Column
Set oTransformation =
oCustomTask3.Transformations.New("DTSPump.DataPump TransformTrimString")
oTransformation.Name = "DTSTransformation__1"
oTransformation.TransformFlags = 63
***** WITHOUT.TXT
Dim oColumn As DTS.Column
Set oTransformation =
oCustomTask3.Transformations.New("DTS.DataPumpTran sformCopy")
oTransformation.Name = "DTSTransformation__2"
oTransformation.TransformFlags = 63
*****

*****
source column names
*****

*****
source Column Sizes
*****

***** with.txt

Set oColumn = oTransformation.DestinationColumns.New("IDNumeral" , 1)
oColumn.Name = "IDNumeral"
oColumn.Ordinal = 1
oColumn.Flags = 120
oColumn.Size = 9
oColumn.DataType = 129
***** WITHOUT.TXT

Set oColumn = oTransformation.DestinationColumns.New("company", 1)
oColumn.Name = "company"
oColumn.Ordinal = 1
oColumn.Flags = 104
oColumn.Size = 30
oColumn.DataType = 129
*****

***** with.txt

oTransProps("TrimLeadingWhiteSpace") = True
oTransProps("TrimTrailingWhiteSpace") = True
oTransProps("TrimEmbeddedWhiteSpace") = False
oTransProps("UpperCaseString") = False
oTransProps("LowerCaseString") = False

***** WITHOUT.TXT


*****
************************************************** *********
The oTransformation As DTS.Transformation2 changes;
The destination oColumn As DTS.Column [Flags] attribute value is
different
Anyone know what that is?
And the afore mentioned additional TransformServerProperties settings
are added.

Now, how again does one put the crap back in the donkey?

thx
md

*** Sent via Developersdex http://www.developersdex.com ***



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.