Sql Server 6.0和7.0 有什么区别?

zhaogang1985 2011-02-21 08:41:18

if not exists(select name from sysobjects where name=''+@name+'' and type='u')
begin
-- 创建
end

type可以用xtype替换,xtype在7.0出现,xtype 和type 有什么区别?

6.0、7.0指的是版本吗?
...全文
159 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
htl258_Tony 2011-02-21
  • 打赏
  • 举报
回复
sysobjects 中有二个表示对象类型的字段(type,xtype)。


type是在 SQL Server 6.0 就有的,xtype在 SQL Server 7.0 才出现的。


对比了一下 type 与 xtype,有一些不同:

type:
K = PRIMARY KEY 或 UNIQUE 约束
R = 规则


xtype:
PK = PRIMARY KEY 约束(类型是 K)
UQ = UNIQUE 约束(类型是 K)


type 是为了与过去的版本相兼容而存在的,SQL Server7.0 之后用 xtype 就可以了。
-狙击手- 2011-02-21
  • 打赏
  • 举报
回复
xtype char(2) Object type.
Can be one of these object types:
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
L = Log
FN = Scalar function
IF = Inlined table-function
P = Stored procedure
PK = PRIMARY KEY constraint (type is K)
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
UQ = UNIQUE constraint (type is K)
V = View
X = Extended stored procedure

type char(2) Object type.
Can be one of these values:
C = CHECK constraint
D = Default or DEFAULT constraint
F = FOREIGN KEY constraint
FN = Scalar function
IF = Inlined table-function
K = PRIMARY KEY or UNIQUE constraint
L = Log
P = Stored procedure
R = Rule
RF = Replication filter stored procedure
S = System table
TF = Table function
TR = Trigger
U = User table
V = View
X = Extended stored procedure

王向飞 2011-02-21
  • 打赏
  • 举报
回复
基本不用研究这个了

没几家单位还在用这样的数据库

[Quote=引用 5 楼 zhaogang1985 的回复:]
不是我用的版本,是看别人代码上、遇到的疑问。。。
[/Quote]
zhaogang1985 2011-02-21
  • 打赏
  • 举报
回复
不是我用的版本,是看别人代码上、遇到的疑问。。。
rucypli 2011-02-21
  • 打赏
  • 举报
回复
SQL Server发展史
· 1988 SQL Server 由微软与Sybase共同开发,运行于OS/2平台。
· 1993 SQL Server 4.2桌面数据库系统,功能较少。与Windows集成并提供了易于使用界面。
· 1994 Microsoft与Sybase在数据库开发方面的合作中止。
· 1995 SQL Server 6.05 重写了核心数据库系统。提供低价小型商业应用数据库方案。
· 1996 SQL Server 6.5
· 1998 SQL Server 7.0 重写了核心数据库系统,提供中小型商业应用数据库方案,包含了初始的Web支持。SQL Server从这一版本起得到了广泛应用。
· 2000 SQL Server 2000 企业级数据库系统,其包含了三个组件(DB, OLAP, English Query)。丰富前端工具,完善开发工具,以及对XML的支持等,促进了该版本的推广和应用。
· 2005 SQL Server 2005 最新版本,历时5年的重大变革。
· 2007 SQL Server 2008(Katmi)即将发布
Q315054403 2011-02-21
  • 打赏
  • 举报
回复
跟Win3.x与95的区别。。。
dawugui 2011-02-21
  • 打赏
  • 举报
回复
你用的这版本也太老了吧?
-晴天 2011-02-21
  • 打赏
  • 举报
回复
太爷爷级的数据库产品.现在应该没人用了.
这一句
if not exists(select name from sysobjects where name=''+@name+'' and type='u')
应该为:
if not exists(select name from sysobjects where name=@name and type='u')
xtype是指系统视图中的列名,与数据类型无关.

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧