Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

RAISERROR QUERY

$
0
0

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


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>