SQLÈ«¾Ö±äÁ¿
SQL Server ϵͳȫ¾Ö±äÁ¿
@@CONNECTIONS
·µ»Ø×ÔÉÏ´ÎÆô¶¯ÒÔÀ´Á¬½Ó»òÊÔͼÁ¬½ÓµÄ´ÎÊý¡£
@@CURSOR_ROWS
·µ»ØÁ¬½ÓÉÏ×îºó´ò¿ªµÄÓαêÖе±Ç°´æÔڵĺϸñÐеÄÊýÁ¿(·µ»Ø±»´ò¿ªµÄÓαêÖл¹Î´±»¶ÁÈ¡µÄÓÐЧÊý¾ÝÐеÄÐÐÊý)
@@DATEFIRST
·µ»ØÿÖܵÚÒ»ÌìµÄÊý×Ö
@@ERROR
·µ»Ø×îºóÖ´ÐеÄSQL Óï¾äµÄ´íÎó´úÂë¡£
@@FETCH_STATUS
·µ»Ø±» FETCH Óï¾äÖ´ÐеÄ×îºóÓαêµÄ״̬£¬¶ø²»ÊÇÈκε±Ç°±»Á¬½Ó´ò¿ªµÄÓαêµÄ״̬¡£
@@IDENTITY
·µ»Ø×îºó²åÈëµÄ±êʶֵ
@@LANGID
·µ»Øµ±Ç°ËùʹÓÃÓïÑԵı¾µØÓïÑÔ±êʶ·û(ID)¡£
@@LANGUAGE
·µ»Øµ±Ç°Ê¹ÓõÄÓïÑÔÃû¡£
@@LOCK_TIMEOUT
·µ»Øµ±Ç°»á»°µÄµ±Ç°Ëø³¬Ê±ÉèÖ㬵¥Î»ÎªºÁÃë¡£
@@PROCID
·µ»Øµ±Ç°¹ý³ÌµÄ´æ´¢¹ý³Ì±êʶ·û (ID) ¡£
@@ROWCOUNT
·µ»ØÊÜÉÏÒ»Óï¾äÓ°ÏìµÄÐÐÊý¡£
@@SERVERNAME
·µ»ØÔËÐÐ µÄ±¾µØ·þÎñÆ÷Ãû³Æ¡£
@@SPID
·µ»Øµ±Ç°Óû§½ø³ÌµÄ·þÎñÆ÷½ø³Ì±êʶ·û (ID)¡£
@@TRANCOUNT
·µ»Øµ±Ç°Á¬½ÓµÄ»î¶¯ÊÂÎñÊý¡£
@@VERSION
·µ»Øµ±Ç°°²×°µÄÈÕÆÚ¡¢°æ±¾ºÍ´¦ÀíÆ÷ÀàÐÍ¡£
@@CPU_BUSY
·µ»Ø×ÔSQL Server ×î½üÒ»´ÎÆô¶¯ÒÔÀ´CPU µÄ¹¤×÷ʱ¼äÆ䵥λΪºÁÃë
@@DATEFIRST
·µ»ØʹÓÃSET DATEFIRST ÃüÁî¶ø±»¸³ÖµµÄDATAFIRST ²ÎÊýÖµSET DATEFIRST£¬ÃüÁîÓÃÀ´Ö¸¶¨Ã¿ÖܵĵÚÒ»ÌìÊÇÐÇÆÚ¼¸
@@DBTS
·µ»Øµ±Ç°Êý¾Ý¿âµÄʱ¼ä´ÁÖµ±ØÐë±£Ö¤Êý¾Ý¿âÖÐʱ¼ä´ÁµÄÖµÊÇΩһµÄ
@@ERROR
·µ»ØÖ´ÐÐTransact-SQL Óï¾äµÄ´íÎó´úÂë
@@FETCH_STATUS
·µ»ØÉÏÒ»´ÎFETCH Óï¾äµÄ״ֵ̬
@@IDLE
·µ»Ø×ÔSQL Server ×î½üÒ»´ÎÆô¶¯ÒÔÀ´CPU ´¦ÓÚ¿Õ±Õ״̬µÄʱ¼ä³¤¶Ìµ¥Î»ÎªºÁÃë
@@IO_BUSY
·µ»Ø×ÔSQL Server ×î½üÒ»´ÎÆô¶¯ÒÔÀ´CPU Ö´ÐÐÊäÈëÊä³ö²Ù×÷Ëù»¨·ÑµÄʱ¼äÆ䵥λΪºÁÃë
@@LANGID
·µ»Øµ±Ç°ËùʹÓõÄÓïÑÔID Öµ
@@LANGUAGE
·µ»Øµ±Ç°Ê¹ÓõÄÓïÑÔÃû³Æ
@@LOCK_TIMEOUT
·µ»Øµ±Ç°»á»°µÈ´ýËøµÄʱ¼ä³¤¶ÌÆ䵥λΪºÁÃë
@@MAX_CONNECTIONS
·µ»ØÔÊÐíÁ¬½Óµ½SQL Server µÄ×î´óÁ¬½ÓÊýÄ¿
@@MAX_PRECISION
·µ»Ødecimal ºÍnumeric Êý¾ÝÀàÐ͵ľ«È·¶È
@@NESTLEVEL
·µ»Øµ±Ç°Ö´ÐеĴ洢¹ý³ÌµÄǶÌ×¼¶Êý³õʼֵΪ0
@@OPTIONS
·µ»Øµ±Ç°SET Ñ¡ÏîµÄÐÅÏ¢
@@PACK_RECEIVED
·µ»ØSQL Server ͨ¹ýÍøÂç¶ÁÈ¡µÄÊäÈë°üµÄÊýÄ¿
@@PACK_SENT
·µ»ØSQL Server д¸øÍøÂçµÄÊä³ö°üµÄÊýÄ¿
@@PACKET_ERRORS
·µ»ØÍøÂç°üµÄ´íÎóÊýÄ¿
@@PROCID
·µ»Øµ±Ç°´æ´¢¹ý³ÌµÄID Öµ
@@REMSERVER
·µ»ØÔ¶³ÌSQL Server Êý¾Ý¿â·þÎñÆ÷µÄÃû³Æ
@@SERVICENAME
·µ»ØSQL Server ÕýÔËÐÐÓÚÄÄÖÖ·þÎñ״̬֮ÏÂÈçMSSQLSer
Ïà¹ØÎĵµ£º
ÏÖÔںܶàÍøÕ¾¶¼ÌṩÁËÕ¾ÄÚµÄËÑË÷¹¦ÄÜ£¬Óеĺܼòµ¥ÔÚSQLÓï¾äÀï¼ÓÒ»¸öÌõ¼þÈ磺where names like ‘%words%’¾Í¿ÉÒÔʵÏÖ×î»ù±¾µÄËÑË÷ÁË¡£
ÎÒÃÇÀ´¿´¿´¹¦ÄÜÇ¿´óÒ»µã£¬¸´ÔÓÒ»µãµÄËÑË÷ÊÇÈçºÎʵÏֵģ¨ÔÚSQL¡¡£Ó£Å£Ò£Ö£Å£Ò£²£°£°£¯£²£°£°£µÍ¨¹ý´æ´¢¹ý³ÌʵÏÖËÑË÷Ëã·¨£©¡£
ÎÒÃÇ ......
Cross Applyʹ±í¿ÉÒԺͱíÖµº¯Êý½á¹û½øÐÐjoin, ÕâÑù±íÖµº¯ÊýµÄ²ÎÊý¾Í¿ÉÒÔʹÓÃÒ»¸ö½á¹û¼¯£¬¶ø²»ÊÇÒ»¸ö±êÁ¿Öµ£¬ÏÂÃæÊÇbook onlineµÄÔÎÄ£¬ÓÐÀý×Ó£¬ÓнâÊÍ¡£
The APPLY operator allows you to invoke a table-valued function for each row returned by an outer table expression of a query. The table-valued function act ......
Êý¾Ý¿âµÄÐÔÄܲâÊÔ¿ÉÒÔ°ïÖúÄãÌáÇ°ÖªµÀÄãµÄϵͳµÄ¸ºÔØÄÜÁ¦£¬¿ÉÒÔ°ïÖúÄã¸Ä½øϵͳµÄʵʩ»òÉè¼Æ£¬¿ÉÒÔ°ïÖúÄãÈ·¶¨Ò»Ð©Éè¼ÆºÍ±à³ÌÔÔò. µ«ÊÇ£¬ÕâÀïÃæÒ²ÓÐÏÝÚå. Èç¹û²»Ð¡ÐÄ£¬Äã»á×Ô¼º°Ñ×Ô¼ºÏݽøÈ¥£¬È´×îÖÕ²»Ã÷°×ÊÇʲôÔÒò. ÕâÀÎÒÄÃһλÏÈÉúΪÀý£¬À´¿´¿´ËûÔõô×Ô¼º°Ñ×Ô¼º¸ãºýÍ¿µÄ.
×î½ü, ÏëÆðÔÚ´æ´¢¹ý³ÌÖо¿¾¹ÊÇʹÓÃÁÙʱ±í»¹ÊÇÊ ......
Ó¦Ò»¸öÅóÓѵÄÒªÇó£¬ÌùÉÏÊղصÄSQL³£Ó÷ÖÒ³µÄ°ì·¨¡«¡«
±íÖÐÖ÷¼ü±ØÐëΪ±êʶÁУ¬[ID] int IDENTITY (1,1)
1.·ÖÒ³·½°¸Ò»£º(ÀûÓÃNot InºÍSELECT TOP·ÖÒ³)
Óï¾äÐÎʽ£º
SELECT TOP Ò³¼Ç¼ÊýÁ¿ *
from ±íÃû
WHERE (ID NOT IN
(SELECT TOP (ÿҳÐÐÊý*(Ò³Êý-1)) ID
from ± ......
I'm continually trying to track down what service packs are installed on various SQL Servers I support. I can never find the right support page on Microsoft's site. So here's an article with all the SQL Server version information I can track down. If you know of any older versions or can help me fil ......