Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
MartinGeschke
Frequent Visitor

How to concat sql query with pipeline parameter?

@concat("SELECT * FROM [dbo].[MyTable] where SourceSystem ='NAV' and NAV_Mandant='W020' and Entry_No_>",activity('LastRecW020NAV').output)

 

I'm using a german system. Because the where filter also need to be Sting in ''  quotation marks it dosn't work.

Is there a alternative text qualifier?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MartinGeschke ,

One alternative approach is to use double single quotes to escape the single quotes within your string.

Here is the changed codes that you can have a try.

@concat("SELECT * FROM [dbo].[MyTable] where SourceSystem =''NAV'' and NAV_Mandant=''W020'' and Entry_No_>", activity('LastRecW020NAV').output)

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
ManasiL
Frequent Visitor

I am trying to insert the activity error in a table in fabric datawarehouse. But because of special characters like *, ' I am unable to insert that error message into table. Any solution for this?

Anonymous
Not applicable

Hi @MartinGeschke ,

One alternative approach is to use double single quotes to escape the single quotes within your string.

Here is the changed codes that you can have a try.

@concat("SELECT * FROM [dbo].[MyTable] where SourceSystem =''NAV'' and NAV_Mandant=''W020'' and Entry_No_>", activity('LastRecW020NAV').output)

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thanks that works!!!  ''text'' double single quotes.

NandanHegde
Super User
Super User

Can you please provide the expected SQL otput statement that you are envisioning to be executed in the database meaning Select * from xyz  format.

And also what is your parameter name and a sample value of that.

 

Using that we would help you make it dynamic? There are 2 ways : 1 using conact and other is direct expression




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.