Something like this
IF NOT EXISTS (SELECT * FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[YourTable]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[YourTable](
....
....
....
)
END
More Related Contents:
- Calculating distance between two points (Latitude, Longitude)
- How to rewrite IS DISTINCT FROM and IS NOT DISTINCT FROM in SQL Server 20008R2?
- T-SQL split string based on delimiter
- WHERE Clause vs ON when using JOIN
- Partition Function COUNT() OVER possible using DISTINCT
- Script to kill all connections to a database (More than RESTRICTED_USER ROLLBACK)
- Using IF ELSE statement based on Count to execute different Insert statements
- How to create a specific SQL Server stored procedure? [closed]
- SQL Server dynamic PIVOT query?
- SQL Server – Best way to get identity of inserted row?
- Should I use != or for not equal in T-SQL?
- How to update two tables in one statement in SQL Server 2005?
- SQL Server Process Queue Race Condition
- Is the NOLOCK (Sql Server hint) bad practice?
- SQL – Subtracting a depleting value from rows
- OR is not supported with CASE Statement in SQL Server
- How to set variable from a SQL query?
- Compare DATETIME and DATE ignoring time portion
- unresolved reference to object [INFORMATION_SCHEMA].[TABLES]
- SQL dot notation
- Split function in SQL Server 2008
- T-SQL How to create tables dynamically in stored procedures?
- What is the equivalent of ‘describe table’ in SQL Server?
- How can I group by date time column without taking time into consideration
- Update query using Subquery in Sql Server
- T-SQL: checking for email format
- SQL – How do I get only the numbers after the decimal?
- How to retrieve records for last 30 minutes in MS SQL?
- Group consecutive rows of same value using time spans
- Why do SQL Server Scalar-valued functions get slower?