Last active
January 22, 2020 00:08
-
-
Save joe-oli/75359e4ed01134499b73eccce9415f56 to your computer and use it in GitHub Desktop.
SQL Server snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--bit(boolean) flag in SQL COlumn. To check for both false or Null use: isnull(MyTable.isBoolCol, 0) = 0 | |
select * from MyTable | |
where isnull(MyTable.isBoolCol, 0) = 0 | |
-- find all tables that have a DateTime column | |
select * from INFORMATION_SCHEMA.COLUMNS | |
where TABLE_NAME like 'hlc%' -- tables starting with hlc | |
and data_type = 'datetime' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment