Check if table exists in MS SQL database
I needed to check if the tables are in the database or not. Here is an example of the SQL query - it returns 1 if one of the tables exists and 0 if they do not exist.
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_NAME = 'RoleClaims' or TABLE_NAME = 'Users')
SELECT 1
ELSE
SELECT 0
You can use this code if you need to check if tables exist. For example, to create tables in case if nullable result
How to Write Formatted Code in Teams Chat
A Hidden Visual Studio Trick: Execute Selected Code with double Ctrl+E
What do to with Zone.Identifier files after importing a WSL machine and copying data