Saturday, 6 December 2014

RAISERROR 50000 error

In SQL i was using below syntax, it was working fine. But after migrating to SQL 2012, i was getting error.
RAISERROR 50000 'Error.'

Error: RAISERROR 50000 error

Solution:
DECLARE @ErrorMsg varchar(500)

SET @ErrorMsg = 'Error'
RAISERROR (@ErrorMsg,16,1)

I have changed my code and updated my stored procedures. Problem solved.