I am writing a Stored procedure in SQL Server 2008. I need to check if a table exists in the database. If it doesn\'t then I need to create it.
How do I do this?
If I am not wrong, this should work:
if not exists (Select 1 from tableName) create table ...