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 (
5 Id INT IDENTITY NOT NULL,
6 Name NVARCHAR(255) null,
10 Id INT IDENTITY NOT NULL,
11 Name NVARCHAR(255) null,
12 Author NVARCHAR(255) null,
13 publisher_id INT null,
16 alter table Book add constraint FK7C80C0CCEB61E439 foreign key (publisher_id) references Publisher
\r