MS SQLÈëÃÅ»ù´¡:Ë÷ÒýÊÓͼ
MS SQLÈëÃÅ»ù´¡:Ë÷ÒýÊÓͼ
ÊÕ²Ø
¡¡
¡¡ÔÚÇ°ÃæÎÒÃÇÒѾÌáµ½¹ýÓйØÊÓͼµÄÏÂÊö¹Ûµã£ºÓÉÓÚÊÓͼ·µ»ØµÄ½á¹û¼¯Óë¾ßÓÐÐÐÁнṹµÄ±íÓÐ×ÅÏàͬµÄ±í¸ñÐÎʽ£¬²¢ÇÒÎÒÃÇ¿ÉÒÔÔÚSQL
Óï¾äÖÐÏñÒýÓñíÄÇÑùÒýÓÃÊÓͼ£¬ËùÒÔÎÒÃdz£°ÑÊÓͼ³ÆΪÐé±í¡£±ê×¼ÊÓͼµÄ½á¹û¼¯²¢²»ÒÔ±íµÄÐÎʽ´æ´¢ÔÚÊý¾Ý¿âÖУ¬¶øÊÇÔÚÖ´ÐÐÒýÓÃÁËÊÓͼµÄ²éѯʱ£¬SQL
Server 2000 ²Å°ÑÏà¹ØµÄ»ù±¾±íÖеÄÊý¾ÝºÏ²¢³ÉÊÓͼµÄÂß¼½á¹¹¡£
¡¡¡¡ÉÏÃæµÄ½áÂÛ³£ÈÃÎÒÃDzúÉúÕâÑùµÄ½¹ÂÇ£ºÓÉÓÚÊÇÔÚÖ´
ÐÐÁËÒýÓÃÁËÊÓͼµÄ²éѯʱ£¬SQL Server 2000
²Å°ÑÏà¹ØµÄ»ù±¾±íÖеÄÊý¾ÝºÏ²¢³ÉÊÓͼµÄÂß¼½á¹¹£¬ÄÇôµ±²éѯËùÒýÓõÄÊÓͼ°üº¬´óÁ¿µÄÊý¾ÝÐлòÉæ¼°µ½¶Ô´óÁ¿Êý¾ÝÐнøÐкϼÆÔËËã»òÁ¬½Ó²Ù×÷£¬ÎãÓ¹ÖÃÒÉ£¬¶¯Ì¬µØ
´´½¨ÊÓͼ½á¹û¼¯½«¸øϵͳ´øÀ´³ÁÖصĸºµ££¬ÓÈÆäÊǾ³£ÒýÓÃÕâÖÖ´óÈÝÁ¿ÊÓͼ¡£
¡¡¡¡½â¾öÕâÒ»ÁîÈËÍ·Í´ÎÊÌâµÄ·½·¨¾ÍÊÇΪÊÓͼ´´½¨¾Û´ØË÷Òý£¬Ö»ÓÐÕâÑù²Å»áÏÔÖøµØÌá¸ßϵͳµÄÐÔÄÜ¡£µ±ÔÚÊÓͼÉÏ´´½¨Á˾۴ØË÷Òýºó£¬ÊÓͼµÄ½á¹û¼¯ÓëÓо۴ØË÷ÒýµÄ±íµÄÊý¾Ý¼¯Ò»ÑùÊÇ´æ´¢ÔÚÊý¾ÝÖеġ£
¡¡¡¡´ËÍ⣬ÔÚÊÓͼÉÏ´´½¨Ë÷Òý»¹»á´øÀ´ÕâÑùµÄºÃ´¦£»ÓÅ»¯Æ÷¿ÉÒÔÔÚÄÇЩÔÚfrom ´Ó¾äÖв»Ö±½ÓÃüÃûÊÓͼµÄ²éѯÖÐʹÓÃÊÓͼË÷Òý£¬¶øÇÒ¶ÔÒÑ´æÔÚµÄÊÓͼ¶øÑÔ£¬ÓÉÓÚ²»±ØÖØбàд²éѯ´úÂ룬´Ó¶øÌá¸ßÁ˲éѯ´ÓË÷ÒýÊÓͼÖмìË÷Êý¾ÝµÄЧÂÊ¡£
¡¡¡¡Èç¹ûÔÚÊÓͼÉÏ´´½¨Ë÷Òý£¬ÄÇôÊÓͼÖеÄÊý¾Ý»á±»Á¢¼´´æ´¢ÔÚÊý¾Ý¿âÖУ¬¶ÔË÷ÒýÊÓͼ½øÐÐÐ޸ģ¬ÄÇôÕâЩÐ޸ĻáÁ¢¼´·´Ó³µ½»ù´¡±íÖС£Í¬Àí£¬¶Ô»ù´¡±íËù½øÐеÄÊý¾ÝÐÞ¸ÄÒ²»á·´Ó³µ½Ë÷ÒýÊÓͼÄÇÀï¡£Ë÷ÒýµÄΩһÐÔ´ó´óÌá¸ßÁËSQL Server ²éÕÒÄÇЩ±»Ð޸ĵÄÊý¾ÝÐС£
¡¡¡¡Î¬»¤Ë÷ÒýÊÓͼ±Èά»¤»ù´¡±íµÄË÷Òý¸üΪ¸´ÔÓ¡£Ëù
ÒÔ£¬Èç¹ûÈÏΪֵµÃÒÔÒòÊý¾ÝÐ޸ĶøÔö¼Óϵͳ¸ºµ£Îª´ú¼ÛÀ´Ìá¸ßÊý¾Ý¼ìË÷µÄËٶȣ¬ÄÇôӦ¸ÃÔÚÊÓͼÉÏ´´½¨Ë÷Òý¡£ÔÚΪÊÓͼ´´½¨Ë÷ÒýÇ°£¬ÊÓͼ±¾Éí±ØÐëÂú×ãÒÔÏÂÌõ¼þ£º
ÔÚÖ´ÐÐCREATE VIEW ÃüÁîʱ£¬±ØÐ뽫ANSI_NULLS ºÍQUOTED_IDENTIFIERÑ¡ÏîÉèÖÃΪON ״̬£»
ÔÚʹÓÃCREATE TABLE ÃüÁî´´½¨Ë÷ÒýËùÒýÓõĻù´¡±íʱ£¬ANSI_NULLS Ñ¡ÏîÓ¦ÉèÖÃΪON£»
¸ÃÊÓͼËùÒýÓõĶÔÏó½ö°üÀ¨»ù´¡±í¶ø²»°üÀ¨ÆäËüµÄÊÓͼ£» ÊÓͼËùÒýÓõĻù´¡±í±ØÐëÓëÊÓͼͬÊôÓÚͬһÊý¾Ý¿âÇÒÓÐÏàͬµÄËùÓÐÕߣ»
ÔÚ´´½¨ÊÓͼʱ±ØÐëʹÓÃSCHEMABINDING Ñ¡Ï
Èç¹ûÊÓͼÒýÓÃÁËÓû§×Ô¶¨Ò庯Êý£¬ÄÇôÔÚ´´½¨ÕâЩÓû§×Ô¶¨Ò庯ÊýʱҲ±ØÐëʹÓÃSCHEMABINDING Ñ¡Ïî £»
ÊÓͼ±ØÐëÒÔowner.objectname µÄÐÎʽÀ´Ê¹ËùÒýÓõıí»òÓû§×Ô¶¨
Ïà¹ØÎĵµ£º
±£»¤SQL ServerÊý¾Ý¿âµÄÊ®´ó¾øÕÐ
http://blog.csdn.net/cncco/archive/2007/09/15/1785880.aspx
1. °²×°×îеķþÎñ°ü
ΪÁËÌá¸ß·þÎñÆ÷°²È«ÐÔ£¬×îÓÐЧµÄÒ»¸ö·½·¨¾ÍÊÇÉý¼¶µ½SQL Server 2000 Service Pack 3a (SP3a)¡£ÁíÍ⣬Äú»¹Ó¦¸Ã°²×°ËùÓÐÒÑ·¢²¼µÄ°²È«¸üС£
2. ʹÓÃMicrosoft»ùÏß°²È«ÐÔ·ÖÎöÆ÷£¨MBSA£©À´ÆÀ¹À·þÎñÆ÷µÄ°² ......
ʵÑéÄÚÈÝ£º
ÕÆÎÕSQL Server 2000µÄÔ¤±àÒë³ÌÐòNSQLPREP.EXEµÄʹÓã¨ÒԿα¾ÀýÌâ1½øÐе÷ÊÔ£©£»
ʵÑé²½Ö裺
Ò»¡¢Êý¾Ý¿â»·¾³ÅäÖÃ
1¡¢´´½¨xueshengÊý¾Ý¿â£¬½¨Á¢student±íµÈ£»
2¡¢¹Ø±Õsql server 2000·þÎñ¹ÜÀíÆ÷£»
3¡¢½«devtoolsÎļþ¼Ð¿½±´µ½£ºC:\Program Files\Microsoft SQL Server
4¡¢½«BinnÎļþ¼Ð¿½±´µ½£ºC:\Program ......
£±.½¨Ò»ÕÅ±í¡¡´æ·ÅÊý¾Ý¡¡ÔÚÏÂÃæ£Ó£Ñ£Ìº¯ÊýÖÐÓÐÓõ½
create table solardata
(
yearid int not null,
data char(7) not null, ......
ͨ³££¬ÄãÐèÒª»ñµÃµ±Ç°ÈÕÆںͼÆËãһЩÆäËûµÄÈÕÆÚ£¬ÀýÈ磬ÄãµÄ³ÌÐò¿ÉÄÜÐèÒªÅжÏÒ»¸öÔµĵÚÒ»Ìì»òÕß×îºóÒ»Ìì¡£´ó²¿·ÖÈË´ó¸Å¶¼ÖªµÀÔõÑù°ÑÈÕÆÚ½øÐзָÄê¡¢Ô¡¢Èյȣ©£¬È»ºó½ö½öÓ÷ָî³öÀ´µÄÄê¡¢Ô¡¢ÈյȷÅÔÚ¼¸¸öº¯ÊýÖмÆËã³ö×Ô¼ºËùÐèÒªµÄÈÕÆÚ£¡ÔÚÕâƪÎÄÕÂÀÎÒ½«½ÌÄãÈçºÎʹÓÃDATEADDºÍDATEDIFFº¯ÊýÀ´¼ÆËã³öÔÚÄãµÄ³ÌÐòÖпÉÄÜÄ ......