SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[THEMSIRETANILARIISL]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[THEMSIRETANILARIISL](
	[HEMSIRETANILARIISLID] [int] IDENTITY(1,1) NOT NULL,
	[HEMSIRETANILARIID] [int] NULL,
	[ACIKLAMA] [nvarchar](500) NULL,
 CONSTRAINT [PK_THEMSIRETANILARIISL] PRIMARY KEY CLUSTERED 
(
	[HEMSIRETANILARIISLID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
END
GO


IF NOT EXISTS(select sysobjects.id from sysconstraints inner join sysobjects on sysobjects.id = constid where sysobjects.name = 'FK_THEMSIRETANILARIISL_THEMSIRETANILARI' and xtype='F')
ALTER TABLE dbo.THEMSIRETANILARIISL ADD CONSTRAINT
	FK_THEMSIRETANILARIISL_THEMSIRETANILARI FOREIGN KEY
	(
	HEMSIRETANILARIID
	) REFERENCES dbo.THEMSIRETANILARI
	(
	HEMSIRETANILARIID
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
	
Go