I have a stored procedure as below
create procedure TestTry
BEGIN
declare @query varchar(max)
SET NOCOUNT ON;
set @query = 'select * from table1 when RECORD_FLAG <> 't'
then Convert(Decimal(10,4),ISNULL(T.HISTORY_PCR ,0)) else '0'';
exec (@query)
end
Here after RECORD_FLAG <> I want to give it in single quotes and also give 0 in single quotes how to give that
The above shown is a sample in real time my query is big I have to give the query in @query only