The user is calling a Stored Procedure with ExecuteScalar. When the SQL doesn't find a match, I'd like to return the results of a different SQL.
For Example:
If this doesn't find a match:
select
amount from Lookup Where application = @app
Then I'd like to return:
select amount from Lookup Where application = "DEFAULT"
My actual situation is more complex than this. The first SQL is in a CASE statement. After my CASE is done, can I check the current ExecuteScalar return value Or someone determine how many records are in the last SQL to execute
Also, ExecuteScalar always seems to get the 1st column of the 1st query. Can I have it get the 1st column from the 3rd query