0
votes

I have the following SQL Command in an OLE DB Source, in a data flow task:

Select Top 5000 * 
From ProcessHistory.ScribeDeadZone1
Where ScribeDeadZoneId > ?

At the moment this works fine. However, I'd like to replace the 5000 with a variable. I can't seem to get the syntax right because everything I try results in an error when I click the Parameters button to set the parameter. I've tried

Select Top ? * and Select Top (?) *. Is this possible to do?

1
Just an idea, could you not build a variable with the entire SQL statement and then use the SQL Command from Variable option?Gareth
@Gareth - Yes I could and I'm actually working in that direction until I get a firm answer to my post.Randy Minder
Gareth's comment IS the answer, and I was going to post it as such until I saw his comment. His suggestion is the only way to do what you want. Firm enough? : )Tab Alleman
@TabAlleman - Yes, and if someone wants to post this as an answer, I'll accept it.Randy Minder
If @Gareth doesn't get to it later today, I will.Tab Alleman

1 Answers

1
votes

You need to build the SQL statement in a variable and then use the SQL Command from Variable option when defining the data source.