Majid842
یک شنبه 03 دی 1391, 20:55 عصر
من در ایجاد کردن این بانک مشکل دارم مشکل از چی ؟؟؟
فقط جدول آخر ایجاد نمیشه !!
USE [Insurance]
CREATE TABLE [Bank]
(
[Code_Bank] int IDENTITY(1,1) NOT NULL Primary Key,
[Name_bank] nvarchar(256) NULL
)
CREATE TABLE [Shobe_Bank]
(
[Code_Bank] int Foreign Key References [bank]([Code_Bank]) on delete No action on Update set null,
[CodeShobe] int Not NULL Primary Key,
[Name] Nvarchar(256) NULL
)
*/
/*
CREATE TABLE [Agency]
(
[Code_Agency] int Not NUll Primary Key ,
[LName_Agency] Nvarchar(256) Null,
[FName_Agency] Nvarchar(256) Null,
)
CREATE TABLE [Policy]
(
[P_ID] Int Not NULL IDENTITY (1,1) Primary Key,
[P_Type] Nvarchar(100) Null,
[P_Year] Int ,
[P_Agency] Int Foreign Key References [Agency]([Code_Agency])on delete No action on Update set null,
[P_Mablgh] Money,
[P_TypePardakht] nvarchar (100),
[P_Date] Date,
)
CREATE TABLE [Chek]
(
[Serial] Int IDENTITY(100,1) Not Null Primary Key ,
[Date_Chek] Date Null,
[Mablgh] Money null,
[Malek] Nvarchar(256) null,
[ShomareHesab] int null,
[CodeShobe] int Foreign Key References [Shobe_Bank]([CodeShobe]) on delete No action on Update set null ,
[Code_Bank] int Foreign Key References [Bank]([Code_Bank]) ON DELETE SET NULL ON UPDATE CASCADE ,
[P_ID] int Foreign Key References [Policy]([P_ID]) on delete set null on Update CASCADE ,
)
فقط جدول آخر ایجاد نمیشه !!
USE [Insurance]
CREATE TABLE [Bank]
(
[Code_Bank] int IDENTITY(1,1) NOT NULL Primary Key,
[Name_bank] nvarchar(256) NULL
)
CREATE TABLE [Shobe_Bank]
(
[Code_Bank] int Foreign Key References [bank]([Code_Bank]) on delete No action on Update set null,
[CodeShobe] int Not NULL Primary Key,
[Name] Nvarchar(256) NULL
)
*/
/*
CREATE TABLE [Agency]
(
[Code_Agency] int Not NUll Primary Key ,
[LName_Agency] Nvarchar(256) Null,
[FName_Agency] Nvarchar(256) Null,
)
CREATE TABLE [Policy]
(
[P_ID] Int Not NULL IDENTITY (1,1) Primary Key,
[P_Type] Nvarchar(100) Null,
[P_Year] Int ,
[P_Agency] Int Foreign Key References [Agency]([Code_Agency])on delete No action on Update set null,
[P_Mablgh] Money,
[P_TypePardakht] nvarchar (100),
[P_Date] Date,
)
CREATE TABLE [Chek]
(
[Serial] Int IDENTITY(100,1) Not Null Primary Key ,
[Date_Chek] Date Null,
[Mablgh] Money null,
[Malek] Nvarchar(256) null,
[ShomareHesab] int null,
[CodeShobe] int Foreign Key References [Shobe_Bank]([CodeShobe]) on delete No action on Update set null ,
[Code_Bank] int Foreign Key References [Bank]([Code_Bank]) ON DELETE SET NULL ON UPDATE CASCADE ,
[P_ID] int Foreign Key References [Policy]([P_ID]) on delete set null on Update CASCADE ,
)