IF NOT EXISTS (SELECT * FROM sys.tables t 
               JOIN sys.schemas s ON t.schema_id = s.schema_id 
               WHERE s.name = 'EHR' AND t.name = 'T_EHR_RUS_NPN56FUJV4')
BEGIN

-- Tables

/***** Object:  Table [EHR].[T_EHR_RUS_NPN56FUJV4] *****/
CREATE TABLE [EHR].[T_EHR_RUS_NPN56FUJV4]
(
    [EhrRusID] int NOT NULL,
    [IdEHR] int NULL,
    [NameEHR] varchar(2048) NULL,
    [isFinalStatus] bit NULL,
    [EhrRusRefBooks] int NOT NULL
)
ON [PRIMARY]

-- Alters

ALTER TABLE [EHR].[T_EHR_RUS_NPN56FUJV4] ADD CONSTRAINT [PK_T_EHR_RUS_NPN56FUJV4]
PRIMARY KEY CLUSTERED ([EhrRusID]) ON [PRIMARY]

ALTER TABLE [EHR].[T_EHR_RUS_NPN56FUJV4] ADD CONSTRAINT [FK_T_EHR_RUS_REF_BOOKS_T_EHR_RUS_NPN56FUJV4_EhrRusRefBooks]
FOREIGN KEY([EhrRusRefBooks]) REFERENCES [EHR].[T_EHR_RUS_REF_BOOKS] ([EhrRusRefBooksID])

END
GO