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

sqlÓï¾äѧϰ±Ê¼Ç(8) Ìí¼ÓÔ¼Êø£¬ÊµÏÖÊý¾ÝÍêÕûÐÔ

USE StudentInfo
--=====================================================
--Author     £ºyangjuncheng  
--Create Date:2010.5.26
--Decription :¸ø±íÌí¼ÓÔ¼Êø£¨¿ÉÒÔÔÚ´´½¨±íʾֱ½ÓÌí¼Ó
--            Ò²¿ÉÒÔʹÓÃalter¹Ø¼ü×Ö¸øÒÑ´æÔڵıíÌí¼ÓÔ¼Êø
--=====================================================
--=====================================================
--±í½á¹¹ËµÃ÷
--tb_student(stu_id,stu_name,class_id,school_id,stu_address,stu_head,stu_age)
--ÆäÖÐstu_headΪvarbinaryÀàÐÍ£¬´æ·ÅѧÉúµÄµç×ÓÕÕƬ
--tb_school(schoo_id,school_name)
--tb_class(class_id,class_name)
--=====================================================
--checkÔ¼Êø£ºÏÞÖÆѧÉúµÄÄêÁä±ØÐëÔÚ0-100Ö®¼ä
ALTER TABLE tb_student
ADD constraint CK_stu_age CHECK(stu_age>0 AND stu_age<100)
--Ö÷¼üÔ¼Êø£º¸øѧÉú±íÌí¼ÓÒ»¸öÖ÷¼üÔ¼Êø
ALTER TABLE tb_student
ADD CONSTRAINT PK_stu_id PRIMARY KEY (stu_id)
--Íâ¼üÔ¼Êø£ºÑ§Éú±íµÄ°à¼¶idÒýÓð༶±íÖеÄid
ALTER TABLE tb_student
ADD CONSTRAINT FK_class_id FOREIGN KEY (class_id) REFERENCES tb_class(class_id)
--Ìí¼ÓĬÈÏÔ¼Êø£ºÑ§ÉúĬÈϵØַΪ‘Öйú’
ALTER TABLE tb_student
ADD CONSTRAINT DF_stu_address DEFAULT('Öйú') for stu_address
--Ìí¼ÓΨһԼÊø£ºÖ¸¶¨Ñ§ÉúÃûΨһÐÔ
ALTER TABLE tb_student
ADD CONSTRAINT UQ_stu_name UNIQUE(stu_name)


Ïà¹ØÎĵµ£º

SQL Server µÄÄ£Äâ

SQL Server µÄÄ£Äâ
רÀ¸×÷¼Ò£ºDeanna Dicken 2010Äê2ÔÂ12ÈÕ
·­Ò룺    UltraDBA      2010Äê5ÔÂ25ÈÕ
Ô­ÌûµØÖ·£ºhttp://www.databasejournal.com/features/mssql/article.php/3863516/SQL-Server-Impersonation.htm
½éÉÜ
SQL Server µÄÄ£Ä⣬»òÉÏÏÂÎÄÇл»£¬ÊÇÒ»ÖÖ·½Ê½£¬ÔÊÐíµ± ......

SQL SERVER 2008 ѹËõ±¸·Ý

/*
    SQL SERVER 2008 ѹËõ±¸·Ý
 
 
 
    SQL SERVER 2008 ÔÚÆóÒµ°æºÍ¿ª·¢°æÖÐÒýÈëÁ˱¸·ÝѹËõ.ʹÓÃÕ߸ö¹¦ÄÜ¿ÉÒÔ¸ü¿ìËٵı¸·ÝÊý¾Ý¿â²¢ÇÒ
    ÏûºÄ¸üÉٵĴÅÅÌ¿Õ¼ä.ѹËõÁ¿ÒÀÀµÓÚÊý¾Ý¿âÖд洢µÄÊý¾Ý.ÀýÈç,º¬ÓÐÖظ´Öµ×Ö·ûÊý¾ÝµÄÊý¾Ý¿â¿ÉÒÔÓÐ
   ......

QtÊý¾Ý¿â£¨Èý£©ÀûÓÃQSqlQueryÀàÖ´ÐÐSQLÓï¾ä£¨Ò»£©


±¾ÎÄÕÂÔ­´´ÓÚwww.yafeilinux.com ×ªÔØÇë×¢Ã÷³ö´¦¡£
SQL¼´½á¹¹»¯²éѯÓïÑÔ£¬ÊǹØϵÊý¾Ý¿âµÄ±ê×¼ÓïÑÔ¡£Ç°ÃæÒѾ­Ìáµ½£¬ÔÚQtÖÐÀûÓÃQSqlQueryÀàʵÏÖÁËÖ´ÐÐSQLÓï¾ä¡£ÐèҪ˵Ã÷£¬ÎÒÃÇÕâÀïÖ»ÊÇQt½Ì³Ì£¬¶ø·ÇרҵµÄÊý¾Ý¿â½Ì³Ì£¬ËùÒÔÎÒÃDz»»á¶ÔÊý¾Ý¿âÖеÄһЩ֪ʶ½øÐÐÉîÈë½²½â£¬ÏÂÃæÖ»ÊǶÔ×î³£Óõļ¸¸ö֪ʶµã½øÐн²½â¡£
ÎÒÃÇÏÂÃ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ