# Sql-server – Check which condition has met – Sql Server

functionssql server

In a simple scalar function, I got several "IFs" separated each of them with a unique condition.

Is there any way that I can check which condition was satisfied without having to change the function to log my conditions?

IF ( SOME CONDITION) RETURN 1;

IF ( SOME OTHER CONDITION ) RETURN 1;


What I need to do is check if the condition met was the first or the second.

EDIT:
I know this looks terrible but I also need to get the SQL code that made the condition work. I have no idea how this is possible but I'm hoping any solution.