USE [xyy_erp] GO declare @tableCount int =0 select @tableCount= count(*) from information_schema.tables where table_name='{0}' if(@tableCount =0) begin SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[{0}]( {1})