Posted on 2008-02-14 21:30
semovy 閱讀(167)
評論(0) 編輯 收藏 所屬分類:
MS SQLServer方面
if exists(select * from sysobjects where id=object_id(N'item') and objectproperty(id,N'isUserTable')=1)
drop table item;
create table item(id int not null identity(1,1) primary key,categoryId int not null foreign key references category(類別ID),itemName varchar(255) default '')
insert into item(categoryId,itemName) values(2,'雜志社');
insert into item(categoryId,itemName) values(2,'dfsdf');
select * from item;