Randy Minder
Randy Minder

Reputation: 48402

Data Flow Task - Using a parameter in a SQL Command in OLE DB Source

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?

Upvotes: 0

Views: 1182

Answers (1)

Gareth
Gareth

Reputation: 5243

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

Upvotes: 1

Related Questions