T-SQL syntax: is "LIKE '%'" legitimate?

Viewed 82

I could have experimented this had I access to a SQL Server instance or other SQL database.

Anyway I came across this SQL server stored procedure, in which there is a factually statement like:

some_field LIKE '%'

I think this is a legitimate statement but what will it return? My take is no matter what the value of some_field is, it always returns TRUE.

1 Answers
some_field LIKE '%'

Will return all values except null. It's the same as:

some_field IS NOT NULL
Related