Posted on 2008-02-14 21:30
semovy 阅读(159)
评论(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;