SQL Server 2005——Ô¶³ÌÁ¬½ÓÅäÖÃ
×î½ü×öÏîÄ¿£¬ÐèÒªÔ¶³Ì·ÃÎÊÊý¾Ý¿â£¬×Ô¼ºÔÚ²éÁËЩ×ÊÁÏ£¬×ܽáÁËһϣ¬Ï£Íû¶Ô´ó¼ÒÓаïÖú£º
×÷Õߣºshinehoo
Ò»¡¢ÅäÖÃSQL Server 2005
1£©°²×°SQL Server 2005¿ª·¢°æ£»
2£©¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->SQL
Server 2005ÍâΧӦÓÃÅäÖÃÆ÷£¬ÔÚ´ò¿ªµÄ½çÃæµ¥»÷“·þÎñµÄÁ¬½ÓµÄÍâΧӦÓÃÅäÖÃÆ÷”£¬ÔÚ´ò¿ªµÄ½çÃæÖÐÕÒµ½Database Engine£¬µ¥»÷“·þÎñ”£¬ÔÚÓÒ²à²é¿´ÊÇ·ñÒÑÆô¶¯£¬Èç¹ûûÓÐÆô¶¯¿Éµ¥»÷“Æô¶¯”£¬²¢È·±£"Æô¶¯ÀàÐÍ"Ϊ×Ô¶¯£¬²»ÒªÎªÊÖ¶¯£¬·ñÔòÏ´οª»úʱÓÖÒªÊÖ¶¯Æô¶¯£»È»ºóµ¥»÷“Ô¶³ÌÁ¬½Ó”£¬Ñ¡Ôñ“ͬʱʹÓÃTCP/IPºÍnamed pipes”£»
3£©¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server
Configuration Manager£¬µã»÷“SQL Server 2005·þÎñ”£¬°ÑËùÓГÆô¶¯Ä£Ê½”¸ÄΪ“×Ô¶¯”£»È»ºó£¬µã»÷“SQL
Server 2005ÍøÂçÅäÖÔÖеēMSSQLSERFERµÄÐÒ锣¬°ÑÇ°Èý¸öÉèÖÃΪ“ÒÑÆôÓÔ£¬ºóÒ»¸ö“VIA”ÉèÖÃΪ“ÒѽûÓÔ£»
4£©¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005-> SQL
Server Management Studio£¬µÇ¼½øÈ¥ÓÒ¼üµã»÷“SERVER424”Êý¾Ý¿â£¬Ñ¡Ôñ“ÊôÐÔ”£¬È»ºóÑ¡Ôñ“Á¬½Ó”£¬¹´ÉÏ“ÔÊÐíÔ¶³ÌÁ¬½Óµ½´Ë·þÎñÆ÷”£¬²¢°Ñ“Ô¶³Ì²éѯ³¬Ê±Öµ”ÉèÖÃΪ0£¨ÎÞ³¬Ê±£©£»ÁíÍ⣬ÔÚ“SERVER424”Êý¾Ý¿â“ÊôÐÔ”ÀïµÄ“°²È«ÐÔ”ÖÐÑ¡Ôñ“SQL ServerºÍWindowsÉí·ÝÑé֤ģʽ”£»ÔÚ¸ùĿ¼Ïµē°²È«ÐÔ”ÀïµÄ“µÇ¼Ãû”£¬Ñ¡ÔñÄúµÄÓû§Ãû“ÊôÐÔ”ÖÐÉèÖÃÃÜÂ루Զ³ÌÁ¬½Ó±ØÐëÒªÉèÖÃÃÜÂë²ÅÐУ©
5£©ËùÓÐÉèÖÃÍê³Éºó£¬ÔÚ¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server Configuration ManagerÖУ¬ÖØÐÂÆô¶¯“SQL Server
2005·þÎñ- >SQL
SERVER(MSSQLSERVER)”¡£
6£©´ò¿ªSQL Server 2005 µÄ1433¶Ë¿Ú
ÅäÖù¤¾ß->Sql Server Configuration
Manager->MSSQLSERVERµÄÐÒ飬¿´¿´TCP/IPÐÒéÊÇ·ñÆô¶¯£¬Èç¹ûÆô¶¯£¬ÓÒ¼ü²Ëµ¥µã“ÊôÐÔ”£¬ÔÚ·ÖÒ³²Ëµ¥ÖÐÑ¡“IPµØÖ·”£¬°Ñ“IP1”ºÍ“IP2”ÖГTCP¶Ë¿Ú”Ϊ1433£¬“ÒÑÆôÓÔ¸ÄΪ“ÊÇ”£»
ÅäÖù¤¾ß->Sql Server C
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
SQL Server 2005 (MSSQLSERVER) ·þÎñ²»ÄÜÆô¶¯
ÔÒò:VIAÐÒ锸øÆôÓÃÁË£¬Í£ÓÓVIAÐÒé”ÎÊÌâ½â¾ö¡£
"VIAÐÒé"Í£Ó÷½·¨£º¿ªÊ¼->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß->SQL Server Configuration Manager ->´ò¿ªºóÕÒµ½"SQL Server 2005 ÍøÂçÅäÖÃ"->MSSQLSERVER ÊôÐÔµÄÐÒé &nb ......
SQL Server 2005 T-SQL Apply
͸¹ýÖ´Ðмƻ®¿ÉÒÔ¿´³ö£¬cross applyÀàËƲ»´øwhereÌõ¼þµÄÁ¬½Ó¼´cross join £¨½»²æÁ¬½Ó¼´µÑ¿¨¶û»ý£º·µ»ØÐÐÊýΪ£ºÇ°±í·ûºÏÌõ¼þµÄÐгËÉϺó±í·ûºÏÌõ¼þµÄÐУ© ¡£ÐÎʽÉÏ»áÁé»îЩ.
ʹÓà APPLY ÔËËã·û¿ÉÒÔΪʵÏÖ²éѯ²Ù×÷µÄÍⲿ±í±í´ïʽ·µ»ØµÄÿ¸öÐе÷ÓñíÖµº¯Êý¡£±íÖµº¯Êý×÷ΪÓÒÊäÈ룬Íⲿ±í±í´ï ......
1.Union
UNION Ö¸ÁîµÄÄ¿µÄÊǽ«Á½¸ö SQL Óï¾äµÄ½á¹ûºÏ²¢ÆðÀ´¡£´ÓÕâ¸ö½Ç¶ÈÀ´¿´£¬ UNION ¸ú JOIN ÓÐЩÐíÀàËÆ£¬ÒòΪÕâÁ½¸öÖ¸Á¿ÉÒÔÓɶà¸ö±í¸ñÖÐߢȡ×ÊÁÏ¡£ UNION µÄÒ»¸öÏÞÖÆÊÇÁ½¸ö SQL Óï¾äËù²úÉúµÄÀ¸Î»ÐèÒªÊÇͬÑùµÄ×ÊÁÏÖÖÀà¡£ÁíÍ⣬µ±ÎÒÃÇÓà UNIONÕâ¸öÖ¸Áîʱ£¬ÎÒÃÇÖ»»á¿´µ½²»Í¬µÄ×ÊÁÏÖµ (ÀàËÆ SELECT DISTINCT)¡£
UNION µ ......