However some databases (eg SQL Server, Oracle) do not have a boolean type. In these cases you may use:
select * from SomeTable where 1=1
BTW, if building up an sql where clause by hand, this is the basis for simplifying your code because you can avoid having to know if the condition you're about to add to a where clause is the first one (which should be preceded by "WHERE"), or a subsequent one (which should be preceded by "AND"). By always starting with "WHERE 1=1", all conditions (if any) added to the where clause are preceded by "AND".
How to write literal boolean value in SQL Server?
select * from SomeTable where PSEUDO_TRUE
There is no such thing.
You have to compare the value with something using = < > like .... The closest you get a boolean value in SQL Server is the bit. And that is an integer that can have the values null, 0 and 1.
SQL Server doesn't have a boolean data type. As @Mikael has indicated, the closest approximation is the bit. But that is a numeric type, not a boolean type. In addition, it only supports 2 values - 0 or 1 (and one non-value, NULL).
SQL (standard SQL, as well as T-SQL dialect) describes a Three valued logic. The boolean type for SQL should support 3 values - TRUE, FALSE and UNKNOWN (and also, the non-value NULL). So bit isn't actually a good match here.
Given that SQL Server has no support for the data type, we should not expect to be able to write literals of that "type".
I question the value of using a Boolean in TSQL.
Every time I've started wishing for Booleans & For loops I realised I was approaching the problem like a C programmer & not a SQL programmer. The problem became trivial when I switched gears.
In SQL you are manipulating SETs of data. "WHERE BOOLEAN" is ineffective, as does not change the set you are working with. You need to compare each row with something for the filter clause to be effective. The Table/Resultset is an iEnumerable, the SELECT statement is a FOREACH loop.
Yes, "WHERE IsAdmin = True" is nicer to read than "WHERE IsAdmin = 1"
Yes, "WHERE True" would be nicer than "WHERE 1=1, ..." when dynamically generating TSQL.
and maybe, passing a Boolean to a stored proc may make an if statement more readable.
But mostly, the more IF's, WHILE's & Temp Tables you have in your TSQL, the more likely you should refactor it.
I hope this answers the intent of the question. Although there are no Booleans in SQL Server, if you have a database that had Boolean types that was translated from Access, the phrase which works in Access was "...WHERE Foo" (Foo is the Boolean column name). It can be replaced by "...WHERE Foo<>0" ... and this works. Good luck!