I need to check if a table in SQL exist or not.
If not it must create one automatically.
Now I researched and found this code:
IF NOT EXISTS (SE
I like this syntax:
if(object_id(N'[dbo].[YourTable]', 'U') is not null)
...
Where object_id takes the 2 char type of object as the second parameter. You can find the list of Object types listed below in the sys.objects documentation: