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
... ...