Mark Mintoff My superpower is common sense


T-SQL IsNullOrEmpty

Lately (because of my line of work) I am using SQL Server more than I am using Visual Studio. I miss some of the functions provided in C# however.

One of them is String.IsNullOrEmpty and SQL Server does not natively have it.

Dead simple, but a comfort in long CASE statements:

Usage is simple and according to expectations:

Unfortunately I do not know of a way to avoid the "= 1" as I do not think boolean/bit values are handled the same in SQL.


VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.