Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Bex
Aged Yak Warrior
580 Posts |
Posted - 2009-03-02 : 09:56:25
|
Hi ThereI have 2 variables, one to store the results of a table and the other, a parameter. When I try and reference the variables in a Execute SQL Task: SELECT TableSchema+'.'+TableName FROM admin.GetTableNames (NULL, 'crdm','template') tblsINNER JOIN [User::GetPartitionDates] dates ON dates.PartitionDate = tbls.PartitionDateWHERE tbls.TemplateObjectID = [User::TemplateObjectID]I get the following error:failed with the following error: "Invalid object name 'User::GetPartitionDates'.".What am i doing wrong?ThanksHearty head pats |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-02 : 10:48:42
|
you need to use expression builder to build the querySELECT TableSchema+'.'+TableName FROM admin.GetTableNames (NULL, 'crdm','template') tblsINNER JOIN '+ @[User::GetPartitionDates] +' dates ON dates.PartitionDate = tbls.PartitionDateWHERE tbls.TemplateObjectID = '+ @[User::TemplateObjectID]then store this tring in another variable and use it as source of sql task. |
 |
|
Bex
Aged Yak Warrior
580 Posts |
Posted - 2009-03-02 : 11:22:21
|
Thanks muchly!!Got it working now!!Hearty head pats |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-02 : 13:09:59
|
welcome |
 |
|
|
|
|