Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
set @Gender=case when @Gender='' then '' else ' and c.Customer_gender like '''+@Gender+'''' end in this what is the meaning of '''+@gender+'''
Posted

1 solution

It looks like someone creates a SQL condition on-the-fly and the idea is that the final sql statement will contain a condition like the
SQL
...  AND c.Customer LIKE 'VariableValueGoesHere' ...

The two apostrophes will translate to a single apostrophe and the third ones stops/starts the string literal.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900