Home Forums SQL Server 2005 Business Intelligence Do I have to use a stored procedure in exe SQL task to use a parameter? RE: Do I have to use a stored procedure in exe SQL task to use a parameter?

  • You should rewrite the query so there is only one parameter.

    SELECT Value = CASE WHEN Arg = '19000101' THEN GETDATE() ELSE Arg END FROM (SELECT Arg = ?) a

    or even

    DECLARE @arg DATETIME;

    SET @arg = ?;

    SELECTValue = CASE @arg WHEN '1900-01-01' THEN GETDATE() ELSE @arg END