hy all,
i'm using the object transform data task from a server (where i'm not dbo) to another server (where i'm dbo).
i'm getting data from a table. i need to select just some records from this table. i need to use a query like this one below...
select * from {table_name} where operationedate in ('20070101', '20070205', '20060524')
... cause everytime i run the dts the operationdate field must be filtered on different date.
so i tried to use the parameter from a global variables. i've tried lots of things but everytime i failed.
i used to try:
select * from {table_name} where operationedate in (?)
but it doesnt work!
any one can understand what i try to explain and even help me?
bye
nicola
Have you tried using a SSIS variable with an expression to build query dinamically?
There are a lot of post about it. You would need the set the EvaluateAsExpression porperty of the variable as TRUE and then build the expression. The expression will use another variable that has the coma delimited list of values with the dates you care about.
|||Build two variables: varInClause (string) & varSQLStatement (string)
For the value of varInClause, you can type your dates including the quotes and commas: '20070101','20070205',...
Set EvaluateAsExpresstion to true on the varSQLStatement variable. In the expressions box, type this as your expression:
"select * from table_name where operationdate in (" + @.{User::varInClause} + ")"
Then, use the variable, varSQLStatement, in your OLE DB source.
|||thank you very much for answered so soon
but maybe i'm still in trouble
i forgot you to say i'm working in SQL Server 2000
i think that is possible to use SSIS only in SQL Server 2005
i'm right or not?
bye
nicola
|||Oh, well, that is a very important piece of information because this is not a DTS forum. If you're working with DTS, you need to post that question on the DTS newsgroup.http://groups.google.com/group/microsoft.public.sqlserver.dts?lnk=srg|||
thank you very much
i'm sorry for time you loose with my problem
bye
nicola
No comments:
Post a Comment