dbTalk Databases Forums  

Converting Decimal to interger within a tranformation

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


Discuss Converting Decimal to interger within a tranformation in the microsoft.public.sqlserver.dts forum.



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

Default Converting Decimal to interger within a tranformation - 12-02-2004 , 02:59 PM






In trying to convert decimal to integer within a transformation using below
code, I am getting error "Invalid Procedure call or argument: 'DTSSource'" at
execution. Can some point out how I can correct the error.

Dim newPRQtyPriceRecieved
newPRQtyPriceRecieved = DTSSource("cast(PRQtyPriceRecieved as integer )")
DTSDestination(" PRQtyPriceRecieved)") =newPRQtyPriceRecieved






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

Default Re: Converting Decimal to interger within a tranformation - 12-02-2004 , 03:20 PM






Is that really the name of your column? cast(PRQtyPriceRecieved as integer )

Where are you doing this?

If you are coming from SQL Server have you tried simply converting in the
statement i.e.

CAST(<Source Column> as <DataType>)


You could even use STR()


--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Liz" <Liz (AT) discussions (DOT) microsoft.com> wrote

Quote:
In trying to convert decimal to integer within a transformation using
below
code, I am getting error "Invalid Procedure call or argument: 'DTSSource'"
at
execution. Can some point out how I can correct the error.

Dim newPRQtyPriceRecieved
newPRQtyPriceRecieved = DTSSource("cast(PRQtyPriceRecieved as integer )")
DTSDestination(" PRQtyPriceRecieved)") =newPRQtyPriceRecieved








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

Default RE: Converting Decimal to interger within a tranformation - 12-02-2004 , 04:05 PM



should be
newPRQtyPriceRecieved = CINT(DTSSource(PRQtyPriceRecieved as integer ))

Ed

"Liz" wrote:

Quote:
In trying to convert decimal to integer within a transformation using below
code, I am getting error "Invalid Procedure call or argument: 'DTSSource'" at
execution. Can some point out how I can correct the error.

Dim newPRQtyPriceRecieved
newPRQtyPriceRecieved = DTSSource("cast(PRQtyPriceRecieved as integer )")
DTSDestination(" PRQtyPriceRecieved)") =newPRQtyPriceRecieved






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

Default RE: Converting Decimal to interger within a tranformation - 12-02-2004 , 04:07 PM



newPRQtyPriceRecieved = CINT(DTSSource("PRQtyPriceRecieved"))

Ed

"Ed" wrote:

Quote:
should be
newPRQtyPriceRecieved = CINT(DTSSource(PRQtyPriceRecieved as integer ))

Ed

"Liz" wrote:

In trying to convert decimal to integer within a transformation using below
code, I am getting error "Invalid Procedure call or argument: 'DTSSource'" at
execution. Can some point out how I can correct the error.

Dim newPRQtyPriceRecieved
newPRQtyPriceRecieved = DTSSource("cast(PRQtyPriceRecieved as integer )")
DTSDestination(" PRQtyPriceRecieved)") =newPRQtyPriceRecieved






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

Default RE: Converting Decimal to interger within a tranformation - 12-03-2004 , 08:53 AM



Thank you all. Its all working with the following code:

DTSDestination("PRQtyPriceRecieved")=cint(DTSSourc e("PRQtyPriceRecieved"))

"Ed" wrote:

Quote:
newPRQtyPriceRecieved = CINT(DTSSource("PRQtyPriceRecieved"))

Ed

"Ed" wrote:

should be
newPRQtyPriceRecieved = CINT(DTSSource(PRQtyPriceRecieved as integer ))

Ed

"Liz" wrote:

In trying to convert decimal to integer within a transformation using below
code, I am getting error "Invalid Procedure call or argument: 'DTSSource'" at
execution. Can some point out how I can correct the error.

Dim newPRQtyPriceRecieved
newPRQtyPriceRecieved = DTSSource("cast(PRQtyPriceRecieved as integer )")
DTSDestination(" PRQtyPriceRecieved)") =newPRQtyPriceRecieved






Reply With Quote
  #6  
Old   
Darren Green
 
Posts: n/a

Default Re: Converting Decimal to interger within a tranformation - 12-07-2004 , 07:24 AM



In message <2FF738F3-79EC-4590-AD73-6604D7F40079 (AT) microsoft (DOT) com>, Liz
<Liz (AT) discussions (DOT) microsoft.com> writes
Quote:
Thank you all. Its all working with the following code:

DTSDestination("PRQtyPriceRecieved")=cint(DTSSourc e("PRQtyPriceRecieved"))

Just be aware that a VB(Script) Integer as produced by CInt is only
equivalent to a smallint in SQL. So if using a int destination column,
use CLng for the conversion, giving a Long data type, albeit in a
variant.

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.