Posted on: 12/4/2014 9:36:17 AM | Views : 438

Hello All,
I am trying to get the value in variable in If Exists SQL statement. Is this possible ??? It is giving me syntax error.
Declare @ErrMsgCode int, @sErrorMsg nvarchar(500), @sErrorSource nvarchar(500), @OrgID int SET @ErrMsgCode = -1; IF EXISTS (SELECT OrgID = OrganizationID FROM ATS_Organization_Lang WHERE OrgName = 'abcd org') ELSE BEGIN SET @ErrMsgCode = 1; GOTO ERROR_HANDLER END If this is not the correct way, then how can validate the value(OrgName) and get the other value(OrgID) ??

Go to the complete details ...