Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Sql Server ºÍ Access ²Ù×÷Êý¾Ý¿â½á¹¹SqlÓï¾ä

н¨±í£º
create table [±íÃû]
(
[×Ô¶¯±àºÅ×Ö¶Î] int IDENTITY (1,1) PRIMARY KEY ,
[×Ö¶Î1] nVarChar(50) default 'ĬÈÏÖµ' null ,
[×Ö¶Î2] ntext null ,
[×Ö¶Î3] datetime,
[×Ö¶Î4] money null ,
[×Ö¶Î5] int default 0,
[×Ö¶Î6] Decimal (12,4) default 0,
[×Ö¶Î7] image null ,
)
ɾ³ý±í£º
Drop table [±íÃû]
²åÈëÊý¾Ý£º
INSERT INTO [±íÃû] (×Ö¶Î1,×Ö¶Î2) VALUES (100,'51WINDOWS.NET')
ɾ³ýÊý¾Ý£º
DELETE from [±íÃû] WHERE [×Ö¶ÎÃû]>100
¸üÐÂÊý¾Ý£º
UPDATE [±íÃû] SET [×Ö¶Î1] = 200,[×Ö¶Î2] = '51WINDOWS.NET' WHERE [×Ö¶ÎÈý] = 'HAIWA'
ÐÂÔö×ֶΣº
ALTER TABLE [±íÃû] ADD [×Ö¶ÎÃû] NVARCHAR (50) NULL
ɾ³ý×ֶΣº
ALTER TABLE [±íÃû] DROP COLUMN [×Ö¶ÎÃû]
ÐÞ¸Ä×ֶΣº
ALTER TABLE [±íÃû] ALTER COLUMN [×Ö¶ÎÃû] NVARCHAR (50) NULL
ÖØÃüÃû±í£º(Access ²»Ö§³Ö)
EXECUTE sp_rename '±íÃû', 'бíÃû', 'OBJECT'
н¨Ô¼Êø£º
ALTER TABLE [±íÃû] ADD CONSTRAINT Ô¼ÊøÃû CHECK ([Ô¼Êø×Ö¶Î] <= '2000-1-1')
ɾ³ýÔ¼Êø£º
ALTER TABLE [±íÃû] DROP CONSTRAINT Ô¼ÊøÃû
н¨Ä¬ÈÏÖµ
ALTER TABLE [±íÃû] ADD CONSTRAINT ĬÈÏÖµÃû DEFAULT '51WINDOWS.NET' FOR [×Ö¶ÎÃû]
ɾ³ýĬÈÏÖµ
ALTER TABLE [±íÃû] DROP CONSTRAINT ĬÈÏÖµÃû


Ïà¹ØÎĵµ£º

ZZʹÓÃSQL Server´æ´¢ASP.NET Session±äÁ¿

´´½¨ºÍÅäÖÃASP.NET Session״̬Êý¾Ý¿â
ÔÚ»ùÓÚNLB£¨ÍøÂ縺ÔØƽºâ£©»·¾³ÏµÄASP.NET WebÓ¦ÓóÌÐò¿ª·¢£¬ÎÒÃÇÐèÒª½«Session´æ´¢ÔÚÊý¾Ý¿âÖ驶à¸öWebÓ¦ÓóÌÐòµ÷Óã¬ÒÔÏÂΪÅäÖ÷½·¨¼°×¢ÒâÊÂÏî¡£
1.´´½¨ÓÃÓÚ´æ´¢ASP.NET SessionµÄÊý¾Ý¿â£¨Ô¶³Ì¡¢±¾µØ½Ô¿É£¬Ê¹ÓÃÊý¾Ý¿âÓû§Éí·ÝÈÏÖ¤£©
ÔÚWindows\Microsoft.NET\Framework/V2.0.507 ......

sql Óï¾ä´¦Àí ÈÕÆÚ´¦Àí

DATENAME([Year],
      dbo.reservation.begintime) + N'Äê' + CAST(DATEPART([Month],
      dbo.reservation.begintime) AS varchar) + N'ÔÂ' + DATENAME([Day],
      dbo.reservation.begintime) + N'ÈÕ' + DATENAME([Hour], dbo.r ......

SQL ServerÓÅ»¯¶þ

1.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖжÔ×ֶνøÐÐ null ÖµÅжϣ¬·ñÔò½«µ¼ÖÂÒýÇæ·ÅÆúʹÓÃË÷Òý¶ø½øÐÐÈ«±íɨÃ裬È磺
select id from t where num is null
¿ÉÒÔÔÚnumÉÏÉèÖÃĬÈÏÖµ0£¬È·±£±íÖÐnumÁÐûÓÐnullÖµ£¬È»ºóÕâÑù²éѯ£º
select id from t where num=0
2.Ó¦¾¡Á¿±ÜÃâÔÚ where ×Ó¾äÖÐʹÓÃ!=»ò<>²Ù×÷·û£¬·ñÔò½«ÒýÇæ·ÅÆúÊ ......

SQLÓÅ»¯( ÒýÓà )



 
SQLÓÅ»¯²éѯ
ÊÕ²Ø



Êý¾Ý¿âµÄ²éѯÓÅ»¯¼¼Êõ
Êý¾Ý¿âϵͳÊǹÜÀíÐÅϢϵͳµÄºËÐÄ£¬»ùÓÚÊý¾Ý¿âµÄÁª»úÊÂÎñ´¦Àí£¨OLTP£©ÒÔ¼°Áª»ú·ÖÎö´¦Àí(OLAP)ÊÇÒøÐС¢ÆóÒµ¡¢Õþ¸®µÈ²¿ÃÅ×îΪÖØÒªµÄ¼ÆËã»úÓ¦
ÓÃÖ®Ò»¡£´Ó´ó¶à ......

¾­µäSQLÓï¾ä

asc °´ÉýÐòÅÅÁÐ
desc °´½µÐòÅÅÁÐ
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ