posts - 0, comments - 77, trackbacks - 0, articles - 356
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          動態創建表

          Posted on 2008-02-14 21:30 semovy 閱讀(168) 評論(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;
          主站蜘蛛池模板: 张家川| 商河县| 南靖县| 广汉市| 长春市| 洪湖市| 调兵山市| 阳谷县| 三门县| 乌拉特前旗| 大关县| 维西| 游戏| 德格县| 金溪县| 台湾省| 汝州市| 南陵县| 大厂| 湖南省| 蓝田县| 安陆市| 甘孜县| 金坛市| 新源县| 桐乡市| 忻州市| 金乡县| 兴隆县| 阿拉尔市| 南昌县| 白水县| 商都县| 武平县| 苏州市| 西盟| 英吉沙县| 乐都县| 荣成市| 曲周县| 镇雄县|