Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
talleman
Starting Member
3 Posts |
Posted - 2004-01-22 : 14:44:29
|
| I'm doing my first LookUp in a simple DTS transformation.Here's my lookup:SELECT MetroIndexFROM MetroWHERE (MetroCode = '?')Here's my Transformation:Function Main() DTSDestination("OrgID") = DTSSource("OrgID") DTSDestination("MetroIndex") =Cint(DTSLookups("lkp_MetroIndex").Execute(DTSSource("MetroCode"))) Main = DTSTransformStat_OKEnd FunctionWhen I test the transformation, it runs without errors, but it gives meresults like this:MetroIndex OrgID0 abq1000010 ...0 ...The lookup should be providing an integer other than 0 for theMetroCodes I am feeding it. The first line has a MetroCode of 'abq',and when I feed that into the LookUp instead of the question mark (?),it returns MetroIndex 209. So why is my lookup returning 0 in mytransformation? Am I referring to it incorrectly? I tried changing theline with the lookup to this: Dim arrMetro arrMetro =DTSLookups("lkp_MetroIndex").Execute(DTSSource("MetroCode")) DTSDestination("MetroIndex") = arrMetro(0)...like the example on sqldts.com, but it gives me a RunTime error,"Type mismatch: arrMetro" on the last line.Anybody see what I'm doing wrong?TIA,Tab |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2004-01-23 : 16:42:15
|
| Some things of this kind may not work with v7.0. |
 |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
|
|
talleman
Starting Member
3 Posts |
Posted - 2004-01-23 : 17:00:16
|
| I'm sorry. I didn't specify that I am using SQL2k on a Win2k server. |
 |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2004-01-23 : 17:25:14
|
No.. Obviously this is not that.quote: How Zen-like of you Stoad.
Many thanks, Jonathan.. And tell me please:what will the SQL be like without "select" statement?Give you only 3 years to find the Answer.... |
 |
|
|
Stoad
Freaky Yak Linguist
1983 Posts |
Posted - 2004-01-23 : 19:01:19
|
| WHERE (MetroCode = '?') << Why quotes? As I can remember.. |
 |
|
|
talleman
Starting Member
3 Posts |
Posted - 2004-01-26 : 09:13:57
|
quote: Originally posted by Stoad WHERE (MetroCode = '?') << Why quotes? As I can remember..
[MetroCode] is a CHAR(3) column. I couldn't find anything saying NOT to use quotes, so I used them. Guess I could try without... |
 |
|
|
|
|
|