dbTalk Databases Forums  

Loading text datatype to a varchar field

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


Discuss Loading text datatype to a varchar field in the microsoft.public.sqlserver.dts forum.



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

Default Loading text datatype to a varchar field - 10-06-2003 , 02:33 PM






I'm transfering a text data field into a varchar data
field and it sometimes takes a very long time. So, I want
to optimize this activeXscript

'************************************************* *********
' Visual Basic Transformation Script
'************************************************* *********

' Copy each source column to the destination column
Function Main()

DTSDestination("CUR_FLAG") = "C"

DTSDestination("NOTES") = DTSSource("Notes")
END IF

Main = DTSTransformStat_OK
End Function


I'm thinking about casting the text field as varchar to
see if it improves performance.
So, how do I cast or convert this text datatype to
varchar. I really don't know the vb syntax. Thanks in
advance for your help. Sandra

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

Default Re: Loading text datatype to a varchar field - 10-06-2003 , 02:52 PM






If you can CAST the TEXT datatype field to a varchar it begs the Q. "Why is
it not a varchar to begin with ?"

the VB func to convert to a string is Cstr()


--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"Sandra" <silvah (AT) wellsfargo (DOT) com> wrote

Quote:
I'm transfering a text data field into a varchar data
field and it sometimes takes a very long time. So, I want
to optimize this activeXscript

'************************************************* *********
' Visual Basic Transformation Script
'************************************************* *********

' Copy each source column to the destination column
Function Main()

DTSDestination("CUR_FLAG") = "C"

DTSDestination("NOTES") = DTSSource("Notes")
END IF

Main = DTSTransformStat_OK
End Function


I'm thinking about casting the text field as varchar to
see if it improves performance.
So, how do I cast or convert this text datatype to
varchar. I really don't know the vb syntax. Thanks in
advance for your help. Sandra



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.