IF EXISTS (
select GETDATE() 'Today Date',date_value 'expiry date',
abs(DATEDIFF(dd,date_value,getdate()))'No of days before expiry'
from dbo.Test_X
where Application_Name='xyz'
AND abs(DATEDIFF(dd,date_value,getdate()))<@NDAYS
)
RAISERROR (N'This is message %s %d.', -- Message text.
10, -- Severity,
1, -- State,
N'number', -- First argument.
5); -- Second argument
can we make RAISERROR second argument dynamic,like can we put abs(DATEDIFF(dd,date_value,getdate()))
returned value in it?
please help or advice