Use BUH

if  not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[tbSFProvNDS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
begin
CREATE TABLE [dbo].[tbSFProvNDS] (
	[Id1] [int] IDENTITY (1, 1) NOT NULL ,
	[IdDt] [int] NOT NULL ,
	[IdKt] [int] NOT NULL ,
	[AuDt] [varchar] (50) COLLATE SQL_Latin1_General_CP1251_CI_AS NULL ,
	[AuKt] [varchar] (50) COLLATE SQL_Latin1_General_CP1251_CI_AS NULL ,
	[PrNDS] [tinyint] NOT NULL ,
	[NumSpr] [varchar] (10) COLLATE SQL_Latin1_General_CP1251_CI_AS NOT NULL ,
	[IdNDSDt] [int] NULL ,
	[IdNDSKt] [int] NULL 
) ON [PRIMARY]


ALTER TABLE [dbo].[tbSFProvNDS] WITH NOCHECK ADD 
	CONSTRAINT [PK_tbSFProvNDS] PRIMARY KEY  CLUSTERED 
	(
		[Id1]
	)  ON [PRIMARY] 


ALTER TABLE [dbo].[tbSFProvNDS] ADD 
	CONSTRAINT [DF_tbSFProvNDS_PrNDS] DEFAULT (0) FOR [PrNDS]

end

