AccessÓëSql ServerÖ®ASP´úÂë±È½Ï
ºǫ́Êý¾Ý¿â£º
[Microsoft Access]
Óë
[Microsoft Sql Server]
¸ü»»Ö®ºó£¬ASP´úÂëӦעÒâÒªÐ޸ĵÄһЩµØ·½£º
[Ò»]Á¬½ÓÎÊÌ⣨¾ÙÀý)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATABASE=mydata;uid=sa;pwd="
[¶þ]ÏàËƺ¯Êý£¨¾ÙÀý£©
[1]DATEDIFF(datepart, startdate, enddate)
ÆäÖГdatepart”²ÎÊý¿ÉÑ¡ÏîÈçÏ£º
ÉèÖà ÃèÊö
————————————
[Microsoft Access]
Äê yyyy
¼¾¶È q
ÔÂ m
Ò»ÄêµÄÈÕÊý y
ÈÕ d
Ò»ÖܵÄÈÕÊý w
ÖÜ ww
Сʱ h
·ÖÖÓ n
Ãë s
[Microsoft Sql Server]
year yy, yyyy
quarter qq, q
month mm, m
dayofyear dy, y
day dd, d
week wk, ww
hour hh
minute mi, n
second ss, s
millisecond ms
-------------------------
»ù±¾Éϲ¶à£¬µ«×¢ÒâµÄÊÇÔÚдµÄʱºò£¬
[Microsoft Access]Òª¼ÓÒýºÅ£¬È磺datediff('d',enddate,'2004/08/01')
[Microsoft Sql Server]Ôò²»ÐèÒª£¬È磺datediff(d,enddate,'2004/08/01')
[2][Microsoft Access]ÖпÉÓÃÈçcstrµÈתÊý¾ÝÀàÐͺ¯Êý£¬¶ø
[Microsoft Sql Server]ÖÐÔòÓÃconvert»òcastº¯Êý£¬È磺
convert(varchar,[amount])µÈ¡£
[3][Microsoft Sql Server]
È¡µ±Ç°Ê±¼äÓÃgetdateµÈµÈ...
[Èý]Óï¾ä
[Microsoft Sql Server]
¿ÉÒÔÓÃ
CASE
WHEN THEN
WHEN THEN
...
ELSE
END
Óï¾ä£¬¶ø
[Microsoft Access]
²»Ö§³Ö¡£
[Microsoft Access]Ò²²»Ö§³ÖbetweenÓï¾ä
[Microsoft Sql Server]Ôò¿ÉÒÔÕâÑùд£º
[date] between @date1 and @date2
[ËÄ]²éѯ±í
[Microsoft Sql Server]
¿ÉÈý¸ö¼°ÒÔÉϱíjoin²éѯ£¬¶ø
[Microsoft Access]
ºÃÏñÖ»ÄÜÁ½¸ö±íÁª½Ó²éѯ£¨´ýȨÍþÈ·ÈÏ£©,
¶øÇÒ[Microsoft Sql Server]¿ÉÓÓ*=”ºÍ“=*”Á¬½Ó·û¡£[Îå]³ýÁãÎÊÌâ
[Microsoft Access]
ÔÚÅöµ½³ýÊýΪÁãʱ£¬×Ô¶¯¶ªµôÏà¹Ø¼Ç¼£¬¶ø
[Microsoft Sql Server]
Ôò»á±¨´í£¬ÇÒ²éѯÖÐÖ¹¡£É¾³ý´úÂ룺
[Microsoft Access]
¿ÉÒÔÕâÑùд£ºdelete * from [table]
[Microsoft SQL Server]
Ö»ÄÜÕâÑùд£ºdelete from [table]
¶à*»á±¨´í
_____________________________________
µ±Ç°ÈÕÆÚ£º
Ïà¹ØÎĵµ£º
Ê×ÏȽéÉÜÒ»ÏÂʲôÊÇ´æ´¢¹ý³Ì£º´æ´¢¹ý³Ì¾ÍÊǽ«³£ÓõĻòºÜ¸´ÔӵŤ×÷£¬Ô¤ÏÈÓÃSQLÓï¾äдºÃ²¢ÓÃÒ»¸öÖ¸¶¨µÄÃû³Æ´æ´¢ÆðÀ´£¬²¢ÇÒÕâÑùµÄÓï¾äÊÇ·ÅÔÚÊý¾Ý¿âÖеģ¬»¹¿ÉÒÔ¸ù¾ÝÌõ¼þÖ´Ðв»Í¬SQLÓï¾ä£¬ ÄÇôÒÔºóÒª½ÐÊý¾Ý¿âÌṩÓëÒѶ¨ÒåºÃµÄ´æ´¢¹ý³ÌµÄ¹¦ÄÜÏàͬµÄ·þÎñʱ£¬Ö»Ðèµ÷ÓÃexecute,¼´¿É×Ô¶¯Íê³ÉÃüÁî¡£
¡¡¡¡Çë´ó¼ÒÀ´Á˽âһϴ洢¹ý³Ìµ ......
select [name] from sysdatabases order by name--µÃµ½Êý¾Ý¿âÖÐËùÓеĿâÃû
select [name] from sysobjects where xtype='U'and [name]<>'dtproperties' order by [name]--µÃµ½Êý¾Ý¿â±íÖеÄÁбí
select [name] from sysobjects where xtype='V' and [name]<>'syssegments' and [name]<>'sysconstraints' ......
±¾ÎÄ´ÓÊý¾Ý¿âÉè¼Æ¡¢¿ª·¢¡¢DBA¹ÜÀíµÈËĸö·½ÃæÐðÊöÁËSQL2005ÓëSQL2000Á½¸ö°æ±¾¼äµÄ¸Ä½ø¡£
¡¡¡¡Ò»¡¢Êý¾Ý¿âÉè¼Æ·½Ãæ
¡¡
¡¡1¡¢×Ö¶ÎÀàÐÍ¡£
¡¡¡¡varchar(max)
varchar(max)ÀàÐ͵ÄÒýÈë´ó´óµÄÌá¸ßÁ˱à³ÌµÄЧÂÊ£¬¿ÉÒÔʹÓÃ×Ö·û´®º¯Êý¶ÔCLOBÀàÐͽøÐвÙ×÷£¬ÕâÊÇÒ»¸öÁÁµã¡£µ«ÊÇÕâ¾ÍÒý·¢Á˶Ôvarchar
ºÍcharЧÂÊÌÖÂÛµÄÀÏÎÊÌâ¡£µ½µ ......
ÓÃASP½¨Á¢Õ¾ÄÚÐÅÏ¢ËÑË÷ϵͳ
¡¡¡¡¼ÙÈçÄãÓµÓÐÒ»¸öÅÓ´óµÄÍøÕ¾£¬ÄÚÈÝÓֶ࣬ÄÇôÀ´·ÃÕßÍùÍùºÜÄÑÕÒµ½×Ô¼ºËùÐèÒªµÄ¶«¶«£¬ÕâʱºòÄã¾ÍÐèÒªÒ»¸öÕ¾ÄÚËÑË÷À´°ïÖúÀ´·ÃÕ߸ü¿ìµÄÕÒµ½Ë÷ÒªµÄ×ÊÁÏÁË£¡ÏÖÔÚÄã¾Í¿ÉÒÔÓÃaspÇáÒ×µÄʵÏÖÕâÖÖ¹¦ÄÜ£¬ºÎ¿öÏÖÔÚÖ§³ÖaspµÄÕ¾µãÕâô¶à£¬ÀûÓÃÕâ¸öËÑË÷ÒýÇæ¿ÉÒÔËÑË÷µ½ÄãµÄÖ÷Ò³ÀïÃæÈκÎÒ»¸öÎļþ ......