简单三步:
1. 新增变量 MaxID和MaxCreateDate以及Variable
2. 放置一个 Execute SQL Task ,用SQL 来获取 MaxID和MaxCreateDate ,并设置Result Set
SELECT MaxCreatedDate = CONVERT(NVARCHAR(255), COALESCE(MAX(created_at), '19900101'), 121) , MaxID = MAX(id) FROM http_requests
3. 点击Data Flow Task, 在属性框中找到 Expressions.点击’…’打开对话框.然后将SqlCommand 替换为变量Variable.
Variable变量通过MaxID和MaxCreateDate获得的值来拼接SQL
"select * from http_requests where created_at >'" + @[User::MaxCreatedDate]+"'" +" and id >" + @[User::MaxID]