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

¹ØÓÚSQL ServerÊý¾Ý¿âÉè¼ÆµÄ¸ÐÎò

תÔØ×Ô£ºhttp://www.cnblogs.com/leonbao/archive/2008/03/07/1094821.html
¹ØÓÚSQL ServerÊý¾Ý¿âÉè¼ÆµÄ¸ÐÎò£¬ÇëÖ¸½Ì
ÓÐÎÊÌâµÄʱºò£¬ÎÒ¾­³£»ØÀ´²©¿ÍÔ°Ñ°ÕҴ𰸣¬¾Ã¶ø¾ÃÖ®£¬×ܽáÁËһЩ¶«Î÷¡£
Íý×ԷƱ¡£¬Çë´ó¼Ò¶àÖ¸³ö´íÎ󣬲¢¸ø³öÒâ¼û
Êý¾Ý¿âÉè¼ÆÈý·¶Ê½»ù±¾Ô­Ôò
µÚÒ»·¶Ê½£ºÊý¾Ý¿â±íÖеÄ×ֶζ¼Êǵ¥Ò»ÊôÐԵģ¬²»¿ÉÔÙ·Ö¡£Õâ¸öµ¥Ò»ÊôÐÔÓÉ»ù±¾ÀàÐ͹¹³É£¬°üÀ¨ÕûÐÍ¡¢ÊµÊý¡¢×Ö·ûÐÍ¡¢Âß¼­ÐÍ¡¢ÈÕÆÚÐ͵ȡ£
Ò²¾ÍÊÇ˵£¬¾ø¶Ô²»Òª³öÏÖÏÂÃæµÄÇé¿ö
ѧÉúÐÅÏ¢
Ò»ÄêÒ»°à£¬97001£¬ÕÅÈý
Õâ¸öºÜÈÝÒ××öµ½°É£¬ºÇºÇ¡£
µÚ¶þ·¶Ê½£ºÊý¾Ý¿â±íÖв»´æÔڷǹؼü×ֶζÔÈÎÒ»ºòÑ¡¹Ø¼ü×ֶεIJ¿·Öº¯ÊýÒÀÀµ£¨²¿·Öº¯ÊýÒÀÀµÖ¸µÄÊÇ´æÔÚ×éºÏ¹Ø¼ü×ÖÖеÄijЩ×ֶξö¶¨·Ç¹Ø¼ü×ֶεÄÇé¿ö£©£¬Ò²¼´ËùÓзǹؼü×ֶζ¼ÍêÈ«ÒÀÀµÓÚÈÎÒâÒ»×éºòÑ¡¹Ø¼ü×Ö¡£
Ò²¾ÍÊÇ˵£¬¾ø¶Ô²»Òª³öÏÖÏÂÃæµÄÇé¿ö
ѧºÅ
ÐÕÃû
ÄêÁä
¿Î³ÌÃû³Æ
³É¼¨
ѧ·Ö
97001
ÕÅÈý
13
»¯Ñ§
88
2
ÆäÖÐѧºÅºÍ¿Î³ÌÃû³ÆÊÇÁªºÏÖ÷¼ü
ÒòΪ£º
(¿Î³ÌÃû³Æ) → (ѧ·Ö)
(ѧºÅ) → (ÐÕÃû, ÄêÁä)
µÚÈý·¶Ê½£ºÔÚµÚ¶þ·¶Ê½µÄ»ù´¡ÉÏ£¬Êý¾Ý±íÖÐÈç¹û²»´æÔڷǹؼü×ֶζÔÈÎÒ»ºòÑ¡¹Ø¼ü×ֶεĴ«µÝº¯ÊýÒÀÀµÔò·ûºÏµÚÈý·¶Ê½¡£Ëùν´«µÝº¯ÊýÒÀÀµ£¬Ö¸µÄÊÇÈç¹û´æÔÚ"A → B → C"µÄ¾ö¶¨¹Øϵ£¬ÔòC´«µÝº¯ÊýÒÀÀµÓÚA¡£Òò´Ë£¬Âú×ãµÚÈý·¶Ê½µÄÊý¾Ý¿â±íÓ¦¸Ã²»´æÔÚÈçÏÂÒÀÀµ¹Øϵ£º
¹Ø¼ü×ֶΠ→ ·Ç¹Ø¼ü×Ö¶Îx → ·Ç¹Ø¼ü×Ö¶Îy
Ò²¾ÍÊÇ˵£¬¾ø¶Ô²»Òª³öÏÖÏÂÃæµÄÇé¿ö
ѧºÅ
ÐÕÃû
ÄêÁä
ËùÔÚѧԺ
ѧԺµØµã
ѧԺµç»°
97001
ÕÅÈý
13
Ç廪
Öйشå
8888888
ÒòΪ£º(ѧºÅ) → (ËùÔÚѧԺ) → (ѧԺµØµã, ѧԺµç»°)
Ìرð×¢Ò⣺ÓÐʱΪÁËÌá¸ßЧÂÊ£¬µÚÈý·¶Ê½¿ÉÒÔ±»´òÆÆ£¡¶à¼ûÓÚÍâ¼üÌرð¶à¶øÇÒÊý¾ÝÁ¿¾Þ´óµÄ±í¡£ÎªÁËÌá¸ß²éѯµÄЧÂÊ£¬¿ÉÒÔÎþÉüÔöɾ¸ÄµÄЧÂÊ¡£
¹ØÓÚ±í¡¢ÊÓͼ¡¢´æ´¢¹ý³Ì£º
±í¾ÍÊÇÓÃÀ´´æ´¢Êý¾ÝµÄ£¬Òª¾¡Á¿Âú×ãÈý¸ö·¶Ê½£¬²»Òª³öÏÖÈßÓàµÄ¶«Î÷¡£
ÊÓͼÊÇÓÃÀ´²éѯÊý¾ÝµÄ£¬¶ÔÓÚûÓÐÍâ¼üµÄ»ù´¡±í£¬¿ÉÒÔÖ±½ÓÓÃÀ´²éѯ¡£¶ÔÓÚÍâ¼ü±È½Ï¶àµÄÒµÎñ±í£¬²éѯ²Ù×÷È«²¿ÒªÍ¨¹ýÊÓͼ¡£
´æ´¢¹ý³ÌºÍ´¥·¢Æ÷ÎÒ»ù±¾²»Óã¬ÎÒÇãÏòÓÚÔÚÊý¾Ý¿â²ãÃæ²»ÒªÌåÏÖÌ«¶àµÄÒµÎñ£¨ÉõÖÁ²»ÌåÏÖ£©£¬ÎÒ°ÑÒµÎñÈ«²¿¼¯ÖÐÔÚ´úÂë²ãÃæ¡£Æäʵ»¹ÓÐÁíÍâÒ»¸öÔ­Òò£¬ÎÒ²»Ì«¾«Í¨Õâ·½ÃæµÄ¼¼Êõ£¬¼ûÁ¼ûÁ¡£
¹ØÓÚË÷Òý£º
ÓÐÅóÓѾٹýºÜºÃµÄÒ»¸öÀý×Ó£¬¾ÛºÏË÷Òý¾ÍÏñÆ´Òô¼ìË÷£¬·Ç¾ÛºÏË÷Òý¾ÍÏñ²¿Ê×Ë÷Òý¡£
Æ´ÒôË÷ÒýÔÚÕû¸ö×ÖµäÖж¼ÊÇÅźÃÐòµÄ£¬¾ÍÏñ²éÓ¢Îĵ¥´Ê£¬ÄãÖ»Òª°´ÕÕÿҳ½ÇÉϵÄÓ¢ÎÄË÷Òý¾Í¿ÉÒÔÏò


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

SQL PL ¼ò½é

----start
     SQL(Structured Query Language)£¬Ò²¾ÍÊǽṹ»¯²éѯÓïÑÔ£¬Ëü±»Éè¼ÆÓÃÀ´²Ù×÷¼¯ºÏµÄ£¬ÊǷǹý³Ì»¯µÄÓïÑÔ¡£Ëæ×ÅÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÒµÎñÂß¼­Ô½À´Ô½¸´ÔÓ£¬´«Í³µÄSQLÒѾ­²»ÄÜÂú×ãÈËÃǵÄÒªÇó£¬ÓÚÊÇÈËÃǶÔSQL½øÐÐÁËÀ©Õ¹£¬Ê¹Ëü¾ßÓÐÁ˹ý³Ì»¯µÄÂß¼­£¬¼´£ºSQL PL¡£SQL PLµÄÈ«³ÆÊÇ SQL Procedural Language£ ......

SQLË÷Òý¸ß¼¶Ó¦ÓÃ

--½áºÏsys.indexesºÍsys.index_columns,sys.objects,sys.columns²éѯË÷ÒýËùÊôµÄ±í»òÊÓͼµÄÐÅÏ¢
select
  o.name as ±íÃû,
  i.name as Ë÷ÒýÃû,
  c.name as ÁÐÃû,
  i.type_desc as ÀàÐÍÃèÊö,
  is_primary_key as Ö÷¼üÔ¼Êø,
  is_unique_constraint as ΨһԼÊø,
  is_disable ......

SQL Server 2008ºÍ΢ÈíÊý¾Ýƽ̨¿ª·¢

Microsoft SQL Server
2008ºÍMicrosoftÊý¾Ýƽ̨Ϊ¿ª·¢ÈËÔ±ÌṩÁËÒ»¸ö×ۺϵıà³Ì¼Ü¹¹£¬ÓÃÓÚ´´½¨Õë¶ÔÒƶ¯É豸¡¢×ÀÃæµçÄÔ¡¢Web·þÎñÆ÷£¬ºÍÆóÒµ·þÎñÆ÷µÄ»ùÓÚÊý¾ÝµÄ½â
¾ö·½°¸¡£Õâ¸öÊý¾Ý±à³Ì»·¾³½«Êý¾Ý·ÃÎʺ͹ÜÀí¼¯³Éµ½Ò»¸öÓ¦ÓóÌÐòµÄÒµÎñÂß¼­ÖУ¬´Ó¶øÌá¸ßÁË¿ª·¢ÈËÔ±µÄÉú²úÁ¦¡£ËüÌṩÁËÒ»¸öÓÃÓÚ¶ÔÒì¹¹Êý¾ÝÔ´µÄÊý¾Ý·ÃÎʺ͹ÜÀí
µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ