-1
 SELECT CAST(Count(1) as VARCHAR(30)) AS SourceRowCount 
 FROM table 
 where countryid= '" +@[User::Id] +"'"+ " "+"
 AND locationid ="'+@[User::ID1]+'"

Expected output

 SELECT CAST(Count(1) as VARCHAR(30)) AS SourceRowCount 
 FROM table 
 where countryid= 1 
 AND locationid =2
Nick.Mc
  • 18,304
  • 6
  • 61
  • 91
jes
  • 1
  • 1
    I edited your question to format your code. Now what's your actual problem? – Nick.Mc Feb 02 '16 at 22:36
  • No question was asked – William C. Feb 03 '16 at 01:38
  • Hi , I tried below expression and got error. please help me SELECT CAST(Count(1) as VARCHAR(30)) AS SourceRowCount FROM table where countryid= '" +@[User::Id] +"'"+ " "+" AND locationid ="'+@[User::ID1]+'" – jes Feb 03 '16 at 09:35

1 Answers1

1

Use an Execute SQL Task step in your Control Flow to execute the query, passing the two variable values in as parameters, and return the value into another variable, https://www.simple-talk.com/sql/ssis/ssis-basics-using-the-execute-sql-task-to-generate-result-sets/ .

Bruce Dunwiddie
  • 2,888
  • 1
  • 15
  • 20