Hey you can try this:
@hamed1374 (equals(coalesce(<<parameter>>, ' '), ' ')) to validate whether the parameter is null
Parameter Null
Hello team,
The pipeline has Comapnies and Tablewith company as a parameter if we pass for whole companies and Tablewithcompany it is taking more than 10 hrs to excute the pipeling so we planned to pass only prmutation and combination like
- 1 companies and 1 Tablewithcompany : It is working perfectly
- 1 companies and Tablewithcompany is null : it is not working properly .
I am passing the parameter value :


I am passing these two parameter
companies :["Group"]
TablesWithCompany :[]
It is not working properly because i have parameterized query where it will fetch like
select * from dbo.Group$[]
I am expecting like to fetch the query :
select * from dbo.Group$Vendor
select * from dbo.Group$GL_Account (It must take all the tablewithcompany data)
The query:
if ISNULL( ('@{ if(lessOrEquals(length(pipeline().parameters.TablesWithCompany),1),
join(pipeline().parameters.TablesWithCompany,''),
concat(join(pipeline().parameters.TablesWithCompany,''','''))
)}'),'')<> ' '
Begin
select DISTINCT RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) AS TableName
from INFORMATION_SCHEMA.TABLES t
where t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_NAME like '%$%'
AND t.TABLE_NAME not like '%$%$%'
AND t.TABLE_NAME not like '%_Bak'
AND t.TABLE_NAME not like '%_%1%'
AND t.TABLE_NAME not like '%_%2%'
AND RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME))
IN ('@{ if(lessOrEquals(length(pipeline().parameters.TablesWithCompany),1),
join(pipeline().parameters.TablesWithCompany,''),
concat(join(pipeline().parameters.TablesWithCompany,''','''))
)}')
End
ELSE
Begin
select DISTINCT RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) AS TableName
from INFORMATION_SCHEMA.TABLES t
where t.TABLE_TYPE = 'BASE TABLE'
AND t.TABLE_NAME like '%$%'
AND t.TABLE_NAME not like '%$%$%'
AND t.TABLE_NAME not like '%_Bak'
AND t.TABLE_NAME not like '%_%1%'
AND t.TABLE_NAME not like '%_%2%'
AND LEFT(t.TABLE_NAME,CHARINDEX('$',t.TABLE_NAME) - 1) <> ''
END
--AND RIGHT(t.TABLE_NAME,LEN(t.TABLE_NAME) -CHARINDEX('$',t.TABLE_NAME)) IN ('Value Entry')
Azure Data Factory
1 answer
Sort by: Most helpful
-
Nandan Hegde 36,716 Reputation points MVP Volunteer Moderator2021-03-23T11:57:16.467+00:00