1 alter table Book drop constraint FK7C80C0CCEB61E439
\r
2 if exists (select * from dbo.sysobjects where id = object_id(N'Publisher') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table Publisher
\r
3 if exists (select * from dbo.sysobjects where id = object_id(N'Book') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table Book
\r
4 create table Publisher (
\r
5 Id INT IDENTITY NOT NULL,
\r
6 Name NVARCHAR(255) null,
\r
10 Id INT IDENTITY NOT NULL,
\r
11 Name NVARCHAR(255) null,
\r
12 Author NVARCHAR(255) null,
\r
13 publisher_id INT null,
\r
16 alter table Book add constraint FK7C80C0CCEB61E439 foreign key (publisher_id) references Publisher
\r