udf issue
-
hi guys i have a filed in my database named status which values is a bit either 0 or 1 , i want to get its values and wanto to translate 0 to inactive and 1 to active and i want to do it at server end in a udf ,how can i do that ? regards .
Tauseef A Khan MCP Dotnet framework 2.0.
-
hi guys i have a filed in my database named status which values is a bit either 0 or 1 , i want to get its values and wanto to translate 0 to inactive and 1 to active and i want to do it at server end in a udf ,how can i do that ? regards .
Tauseef A Khan MCP Dotnet framework 2.0.
Hope you are looking for this.
select case when status=0 then 'inactive' when status=1 then 'active' end as [Status] from tablename
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Hope you are looking for this.
select case when status=0 then 'inactive' when status=1 then 'active' end as [Status] from tablename
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
-
Hope you are looking for this.
select case when status=0 then 'inactive' when status=1 then 'active' end as [Status] from tablename
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
I would use and else to trap the 2, -2 values
Never underestimate the power of human stupidity RAH