Parameter question
Tried to pass the parameter and run the SQL Query, but have errors. Not sure if i set the parameters correctly.
Error Message:
[Execute SQL Task] Error: Executing the query "UPDATE BOM
SET EQM_UPDATE_DT_GMT = result.MAX_DATE..." failed with the following error: "The multi-part identifier "result.FAC" could not be bound.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly,
parameters not set correctly, or connection not established correctly.
wailun3
May 27th, 2013 11:52pm
Hi ,
It's nothing to do with parameter passing. Check your query in SSMS first. Make sure it's working.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2013 1:57am
I tried to update the SQL like that:
UPDATE BOM
SET EQM_UPDATE_DT_GMT = result.MAX_DATE
from
(SELECT MAX(UPDATE_DT_GMT) MAX_DATE, b.EQP_NUM EQP, b.FAC_NAME FAC
from
dbo.EQM e, BOM b
WHERE
b.EQP_NUM = e.CNTR_NUM
and b.FAC_NAME = e.FCIL_CDE
group by b.EQP_NUM , b.FAC_NAME
) result
WHERE result.EQP = EQP_NUM
AND result.FAC = FAC_NAME
AND result.EQP= " @[User::eqp_num]"
AND result.FAC= " @[User::fac_code]"
But the result are the same. The SQL is worked in SQL Server. Thanks.
wailun3
May 28th, 2013 2:22am
What kind of connection are you using? OLE DB / ADO.Net / etc
http://technet.microsoft.com/en-us/library/ms140355.aspxPlease mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2013 2:31am
I am using OLE DB. Actually i think use "?" in my case.
Actually the SQL query in the For Loop. I tried to parse the SQL query alone and it works. But when run the whole procedure (including the loop) and it fails and the error message showed in my previous message.
wailun3
May 28th, 2013 2:42am
Hi,
I just created your environment and tested your scenario. It's working fine within a loop.
I assumed EQP and FAC are varchar columns.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2013 3:57am