Hi,
I am having an expression task which has the following code in it:-
@[User::VendorFileName] = TOKEN(RIGHT( @[$Package::FilePath] , FINDSTRING(REVERSE(@[$Package::FilePath]), "\\", 1) -1),".",1)
When we evaluate the above code it shows the output i.e V100
Below this I have an Execute Sql task in which I am passing dynamic sql statement through an expression,
Code below:-
"SELECT
p.partition_number AS PartitionNmber
FROM sys.indexes i
INNER JOIN sys.partitions p
ON i.object_id=p.object_id
AND i.index_id=p.index_id
INNER JOIN sys.partition_schemes ps
ON ps.data_space_id = i.data_space_id
INNER JOIN sys.partition_functions pf
ON pf.function_id = ps.function_id
LEFT OUTER JOIN sys.partition_range_values rv
ON rv.function_id = pf.function_id
AND rv.boundary_id = p.partition_number
WHERE i.object_id = object_id('" + @[User::StagingTableSchemaName] + "." + @[User::StagingTableName] + "')
AND rv.value= '" + @[User::VendorFileName] + "'"
When I evaluate the above request it gives me :-
SELECT
p.partition_number AS PartitionNmber
FROM sys.indexes i
INNER JOIN sys.partitions p
ON i.object_id=p.object_id
AND i.index_id=p.index_id
INNER JOIN sys.partition_schemes ps
ON ps.data_space_id = i.data_space_id
INNER JOIN sys.partition_functions pf
ON pf.function_id = ps.function_id
LEFT OUTER JOIN sys.partition_range_values rv
ON rv.function_id = pf.function_id
AND rv.boundary_id = p.partition_number
WHERE i.object_id = object_id('STG.tablename')
AND rv.value= ''
The issue is that it is not populating
rv.value
value and it is taking blank.
Can someone suggest where am i going wrong?
What I have tried:
I tried using delayvalidation set to true. but it did not work