摘要: 省份表:Provincecreate table Province( PRID int identity(1,1) primary key, ProName varchar(50) not null, Spell char(10) not null,)城市表:Citycreate table City( CID int identity(1,1) primary key, CName varchar(50) not null, PRID int not null foreign key(PRID) references Province(PRID)---外键)INSERT INTO Provi 阅读全文
posted @ 2013-03-24 16:39 程序员--靖 阅读(1816) 评论(0) 推荐(0)
摘要: 最近重新做开发,又自己动手写了SQL语句,所以把一些东西记录到这里,为了加深印象,大家一起交流。假设有一张表,名为:Personaleif exists (select * from sysobjects where object_id(N'Personale') and OBJECTPROPERTY(id,N'IsUserTable')=1)drop table [db0]_[Personale](或drop table Personal)这句话想必大家都知道是用来在判断数据库中是否存在某一张表,存在就删除掉字母'N'是SQL-92 标准中的 阅读全文
posted @ 2013-03-24 16:01 程序员--靖 阅读(1170) 评论(0) 推荐(0)