?
Solved

Data Type mismatch in Transformation

Posted on 2003-12-09
3
Medium Priority
?
641 Views
Last Modified: 2007-12-19
Hey Folks,

I rather new at DTS packages, so here goes...

I have an XL spreadsheet that I am trying to load into MSSQL2000.

most of the transformations are straight column copy.

I have one transformation that does a lookup, named 'CycleNo'.  here is my SQL for the lookup

SELECT     Cycle
FROM         CC_EachCycleInfo
WHERE     (SAPCustNo = ?)
ORDER BY Cycle DESC

here is vbscript for the transform

Function Main()
  DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute( DTSSource("SAPCustNo"))
  Main = DTSTransformStat_OK
End Function

when I test the transformation I get a 'data type mismatch in criteria expression' error

data type for DTSSource("SAPCustNo") is Long (this is from the tooltip you get when hovering over the fieldname of the transformations tab in the transform data task properties window.)

data type for  DTSDestination("CycleNo") is BIGINT

if I hardcode DTSSource("SAPCustNo") like ...

DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute(10266)

then it works


I have another transformation that is displaying the same symptoms, but If I can get this working then I can probably get the other one working.

'====================================================================
PART II

on another note.  I am also using a few global variables, but when I specify the data types in the 'global variables' tab of the Edit DTS Package dialog my changes dont seem to get saved.  i.e. I have a GlobVar named SAPCustNo that is set to 'STRING'  when I change it to 'INTEGER', Save/Exit and Edit the package again, the data types for all my GlobVars are set to string again.  ARGHH!!

does anyone have any ideas on this?
0
Comment
Question by:DialM4Monkey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 1200 total points
ID: 9908430
long and bigint are different datatypes.  wrap your DTSDestination("CycleNo") with a clng function:


Function Main()
  DTSDestination("CycleNo") =     DTSLookups("CycleNo").Execute(clng( DTSSource("SAPCustNo")))
  Main = DTSTransformStat_OK
End Function


On your Global variable problem, right click anywhere on "white space" inside your package and choose "disconnected edit".  Search the dts properties for your global data types and change them there--you might have more luck.
Brett
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question