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

SQL ServerÖеÄÔ¼ÊøÌõ¼þ

1.ĬÈÏÔ¼Êø£º¶¨Òå¸ÃÁÐδÊäÈëֵʱӦ¸Ã¾ßÓеÄĬÈÏÖµ
SQL-------alter table ±íÃû add constraint dt_ÁÐÃû default ĬÈÏÖµ for ÁÐÃû
2.¿ÕÖµÔ¼Êø£º¶¨Òå¸ÃÁÐÊÇ·ñÔÊÐíΪ¿ÕÖµ
SQL-------¶¨Òå±íµÄʱºòÔÚ¶ÔÓ¦ÁÐÁÐÊý¾ÝÀàÐͺóÃæÌí¼Ónot null
3.¼ì²éÔ¼Êø£ºÓÖ½ÐcheckÔ¼Êø£¬ÓÃÀ´ÏÞÖÆÁеÄÈ¡Öµ£¬Ëü¸ù¾Ý¶¨ÒåµÄÂß¼­±í´ïʽÀ´Ç¿ÖÆÓòµÄÍêÕûÐÔ
SQL-------alter table ±íÃû add constraint ck_ÁÐÃû check(Âß¼­±í´ïʽ)
4.ΨһԼÊø£ºÈ·±£ÔÚ·ÇÖ÷¼üÁв»ÊäÈëÖظ´Öµ
SQL-------alter table ±íÃû add constraint uq_ÁÐÃû unique[clustered | nonclustered](ÁÐÃû)
5.Íâ¼üÔ¼Êø£ºÓÃÓÚ½¨Á¢Á½¸ö±íÊý¾ÝÖ®¼äÁ¬½ÓµÄÒ»Áлò¶àÁÐ
SQL-------alter table ±íÃû add constraint fk_ÁÐÃû foreign key(ÁÐÃû) references ÁíÒ»±íÃû(ÁÐÃû)
6.Ö÷¼üÔ¼Êø£ºÓÃÀ´Î©Ò»µØ±êʶ±íÖеÄÿһÐÐ
SQL-------alter table ±íÃû add constraint pk_ÁÐÃû primary key(ÁÐÃû)
 
ÐÂÔöÁУºalter table ±íÃû add ÐÂÁÐÃû Êý¾ÝÀàÐÍ
ɾ³ýÁУºalter table ±íÃû drop column ÁÐÃû
ɾ³ýÔ¼Êø£ºalter table ±íÃû drop constraint Ô¼ÊøÃû
ÐÞ¸ÄÁÐÊý¾ÝÀàÐÍ£ºalter table ±íÃû alter column ÁÐÃû ÐÂÊý¾ÝÀàÐÍ
ÐÞ¸ÄÁÐÃûÐèÒªµ÷Óô洢¹ý³Ìsp_rename


Ïà¹ØÎĵµ£º

Sql Server ÖÐÈÕÆÚ¸ñʽ»¯º¯Êý

Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varch ......

¶ÁÈ¡SQL±íÉú³ÉTREEVIEW

Public Function GetDataTable()
Dim myComm As New SqlClient.SqlCommand("SELECT cauth_id,cauth_name,igrade,csupauth_id,csupauth_name from MAIN_TREE01 ", sqlconnection1)
Dim sdapt As New SqlClient.SqlDataAdapter(myComm)
Dim ds As New DataSet
sdapt.Fill(ds)
R ......

ÓÃC++·ÃÎÊSQL Server 2000µÄʵÀý

Ò»¡¢ADO¼ò½é
¡¡¡¡ADO(ActiveX Data Object)ÊÇMicrosoftÊý¾Ý¿âÓ¦ÓóÌÐò¿ª·¢µÄнӿڣ¬Êǽ¨Á¢ÔÚOLE DBÖ®Éϵĸ߲ãÊý¾Ý¿â·ÃÎʼ¼Êõ,²»½ö¼òµ¥Ò×Ó㬲¢ÇÒ²»Ê§Áé»îÐÔ.²»Ê§ÎªC++ÀûÓÃÊý¾Ý¿â¿ìËÙ¿ª·¢µÄ²»´íÑ¡Ôñ¡£
¡¡¡¡ÀíÂ۾Ͳ»ÓÃÎÒÔÚÕâ¶ù·Ñ»°ÁË,ÍøÉÏÓкܶà,µ«¹âÊÇÀíÂÛ,Ò²²»ÊDz»¹»µÄ,ADO·ÃÎÊÊý¾ÝµÄ·½·¨ºÜÁé»î,ÈÝÒ×ÈÃÈË»ìÏý.ÍøÉÏ´ó²¿·Ö ......

SQL ¸ßЧͨÓ÷ÖÒ³´æ´¢¹ý³Ì(Ë«Ïò¼ìË÷)

create PROC [dbo].[P_viewPage_A]
/*
¸ßЧͨÓ÷ÖÒ³´æ´¢¹ý³Ì(Ë«Ïò¼ìË÷)
¾´¸æ£ºÊÊÓÃÓÚµ¥Ò»Ö÷¼ü»ò´æÔÚΨһֵÁеıí»òÊÓͼ
ps:SqlÓï¾äΪ8000×Ö½Ú,µ÷ÓÃʱÇë×¢Òâ´«Èë²ÎÊý¼°sql×ܳ¤¶È²»Òª³¬¹ýÖ¸¶¨·¶Î§
*/
@TableName VARCHAR(200),     --±íÃû
@FieldList VARCHAR(2000),    --ÏÔʾÁÐà ......

ibatisÖÐÖ±Ö´ÐÐsql£¬·µ»Ø´æ´¢MapµÄListÀàÐÍ

ibatis×÷Ϊһ¸öÇáÁ¿¼¶µÄorm¹¤¾ßÏÖÔڷdz£Á÷ÐУ¬ÎÒÔÚʹÓÃÖз¢ÏÖ£¬ÓÐʱ½ö½öÏ£Íû·µ»ØÒ»¸öÀàÐÍΪmapµÄlist¾Í¿ÉÒÔÁË£¬
±ÈÈç¼òµ¥µÄ²éѯͳ¼ÆÖ®ÀàµÄ£¬Ã»ÓбØÒª¶¨ÒåÌ«¶àµÄpojo£¬Òò´ËÏëÄܲ»ÄÜÔÚibatisÖÐÖ±½Ó´«ÈësqlÓï¾äÀ´Ö´ÐУ¬È»ºó·µ»ØmapÄØ£¿
´ÓÍøÉÏËÑÁËһϣ¬»¹ÕæÓУ¬ÊµÑé³É¹¦ºó×ܽáһϣ¬´ó¼Ò¹²Í¬½ø²½¡£ ÆäʵºÜ¼òµ¥£¬¾Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ