Link to home
Start Free TrialLog in
Avatar of itnifl
itniflFlag for Norway

asked on

Finding error messages intended for the user application in an immense amount of TSQL code

In an effort to streamline and systematize error message that are presented to the user from the application system we are developing/sustaining, I have made a complete list of error message and where they are found in the code base.

Except for error messages that origin from views and stored procedures in the MSSQL database that is the backend for this system.

When I searched for error messages in the application code base, I used regular expressions to look for hardcoded error messages in the source code. I also manually looked through all .resx files for error messages. But I am not sure of what is the best approach when searching for error messages in views and stored procedures.

The amount of views and stored procedures in the database backend is huge, and it will take an immense amount of time to read through it all manually. I also don't trust that I will catch all error messages sufficiently by manually reading all the code.

So, are there any good ideas on how to approach this task of finding error messages in views and stored procedures in an MSSQL database in a quick as possible and efficient way?
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Do they have any format / construct as a message ?

Otherwise you would be searching for strings and if error messages are unstructured, will be hard to differentiate....

Maybe a couple of examples would help....

You could export SP's Functions, Views etc to disk file and use a similar approach with your resx files....
Avatar of itnifl

ASKER

I exported the whole database into one big sql file using ReadyRoll Pro. I ended up with a scriptfile that was 99 192 lines long. Started out by searching for text like 'RAISERROR', 'check' and 'error' in the scriptfile using Notepad++. It became clear that some stored procedures where being used for error handeling. I used the name of these and searched them up by using a text search for further information. This way I found 22 places where error messages were being generated, but I bet there could be far more.
ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial