您的位置:首页 > 数据库

Access 2003 与 MS SQL 2000 [sql]

2006-01-12 20:24 323 查看
MS SQL 2000 与 Access 2003 sql[ANSI89/92]语言使用的区别:
在使用这两种数据库时候,发觉它们差别还是比较大的,总结了几点出来

数据库技术我采用ADO.NET来访问MS SQL 2000 [开发平台用vs 2003],
采用ADO 2.6来访问Access 2003 [开发平台用vb 6.0]测试

1.支持的数据类型不同
MS SQL 2000 Access 2003
varchar(0-8000) text(0-255)
int/bigint integer/数字
long 数字
标识位 自动编号
bit(0/1) 是/否(true/false)
text 备注[好像只有4k容量]
DateTime 日期[Date],时间[Time],日期时间
image ole对象
2.关键字
id,name,user在MS Server 2000的sql中都是关键字,使用时需[id],[name]
而在access中不是
3.语句
A.
select 'username'=a from table1
ms server 2000支持 Access不支持
select a as username from table1
ms server 2000支持 Access 2003支持
B.
insert table1 values('a',1)
ms server 2000支持 Access不支持
insert into table1(c1,c2) values('a',1)
ms server 2000支持 Access 2003支持
C.
delete table1 where [id]=1
ms server 2000支持 Access不支持
delete from table1 where [id]=1
ms server 2000支持 Access 2003支持
D.
bool类型的列更改数据
ms server 2000
update t1 set c2=1 where [id]=1
Access 2003
update t1 set c2=true where id=1
4.内置函数
MS Sql Server 2000 Access 2003
substring mid
len len
trim trim
left left
right right
getDate now
... ...
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐