title: Query not working in execute SQL task in the ssis package
body: <p>This query works fine in the query window of SQL Server 2005, but throws error  when I run it in Execute SQL Task in the ssis package.</p>
  <pre><code>declare @VarExpiredDays int
  Select  @VarExpiredDays= Value1 From dbo.Configuration(nolock) where  Type=11                      
    DECLARE  @VarENDDateTime datetime,@VarStartDateTime datetime                
    SET @VarStartDateTime= GETDATE()- @VarExpiredDays            
    SET @VarENDDateTime=GETDATE(); 
  
    select  @VarStartDateTime
    select  @VarENDDateTime
    
     SELECT * FROM
  (SELECT CONVERT(Varchar(11),@VarStartDateTime,106) AS VarStartDateTime) A,
  (SELECT CONVERT(Varchar(11),@VarENDDateTime,106) AS VarENDDateTime) B
    
  </code></pre>
  <p>What is the issue here?</p>