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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 passing variable-Syntax error, permission violatio

Author  Topic 

Babli
Yak Posting Veteran

53 Posts

Posted - 2009-03-22 : 07:23:30
Hi,
I am using a execute sql task with the following query:

SET NOCOUNT ON
update DOO
set DOO.Manufacturing_Variance=
DMV.DollarVariance *
( cast(DOO.Standard_Variable_Overhead_Cost as money)+ cast(DOO.Special_Order_Cost as money)
)
from dlt_oes_orders DOO, dlt_mf_variances DMV
Where
DOO.Product_Line_Code = DMV.ProductLineCode
and DOO.Fiscal_Year = DMV.FiscalYear
and DOO.Fiscal_Period = DMV.FiscalPeriod
and DMV.ProcessingTime=?

and i am passing value to DMV.ProcessingTime through a variable which is declared as datetime in variables and as date in Parametermapping.But i am getting the below error:

[Execute SQL Task] Error: Executing the query ".... "failed with the following error: "Syntax error, permission violation, or other nonspecific error". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.



the same query runs in SSMS and if i change the value of ? to getdate()in execute sql task...

what is wrong??
   

- Advertisement -