I have a table like this:TblARowId Identity, Not NullValidRecord BitException1 BitEception2 BitException3 BitValues:TblARowId ValidRecord Exception1 Exception2 Exception31 0 1 1 02 1 0 0 03 0 0 1 14 0 0 0 1
I have another table ExceptionsMasterExceptionId nvarchar(50) not nullExceptionDescription nvarchar(300) not nullValues:ExceptionNo ExceptionDescriptionException1 First Name is null / blankException2 Email Id is null / blankException3 Phone Number is null / blank
I have to create a log file from TblA in the following format:Row number = 1 *** ERROR First Name is null / blankRow number = 1 *** ERROR Email Id is null / blankRow number = 3 *** ERROR Email Id is null / blankRow number = 3 *** ERROR Phone Number is null / blankRow number = 4 *** ERROR Phone Number is null / blankTo get this kind report I have to get the rowid from TblA and ExceptionDescription from ExceptionMaster for that exceptionMy current query is:Select RowId,ExceptionDescription from TblA,ExceptionMaster where(exception1=1 and exceptionno = 'exception1') or (exception2=1 and exceptionno='exception2') or (exception3=1 and exceptionno = 'exception3')
This gives me the RowId and ExceptionDescription for that rowid. Is there any other better way to do this?Karunakaran___________NOTHING IS IMPOSSIBLE, IMPOSSIBLE JUST TAKES LONGER...