Best way to use an INFORMATION_SCHEMA view. These views are most standard across the plateform.
To check if a table exists use:
IF (EXISTS (SELECT *FROM INFORMATION_SCHEMA.TABLESWHERE TABLE_SCHEMA = 'dbo'AND TABLE_NAME = 'UserLogin'))BEGIN--Do Stuffprint 'hello'ENDOutput:
hello