Always include the error message in your question to get quick answers.
IIRC you should use the condition like below(
IF EXISTS
)
IF EXISTS(select Orderno from k_Fs_orderdetails where attrited = 'false')
Check this one for simple example
Drop Stored Procedure if exist in SQL Server[
^]
OR get the value(first SELECT query result) in a variable, use IF condition for that to create conditions
And careful with case sesitive things. Yes, why are you using 'false' & 'TRUE'. Use either lowercase or UPPERCASE for both values. I recommend you to use functions
UPPER
/
LOWER
in your query to get right resultset.