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

ÈçºÎ²é¿´SQL Server ²¹¶¡µÄ°æ±¾£¿

 Õâ¸öÌâÄ¿ÌýÆðÀ´Ê®·ÖÞÖ¿Ú£¬Ó¢ÎÄÓ¦¸ÃÕâÑùд“How to find the service pack version installed on SQL Server using”£¬Õâ¸öÎÊÌâÎÒÒ»Ö±ÔÚÕÒ£¬SQL ServerһֱûÓÐÏñÆäËûÈí¼þÒ»Ñù¿ÉÒÔÖ±½Ó²é¿´µ½°æ±¾+²¹¶¡ºÅµÄ·½·¨£¬½ñÌìµ½Ò»¸öÀÏÍâµÄÍøÕ¾ÖÕÓÚÕÒµ½ÁË£º
ÓÐÁ½ÖÖ·½·¨£º
µÚÒ»²½£ºÊ¹ÓÃSQLÓï¾ä²éѯ
select @@version
²éѯ½á¹ûÈçÏ£º
Microsoft SQL Server  2000 - 8.00.2039 (Intel X86) 
  May  3 2005 23:18:38 
  Copyright (c) 1988-2003 Microsoft Corporation
  Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
ÆäʵÔÚC:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlservr.exe
µã»÷Êó±êÓÒ¼ü²é¿´°æ±¾Ò²Äܵõ½£¬²»¹ýÐÅÏ¢±È½Ï¼òµ¥¶øÒÑ¡£8.00.2039¾Í´ú±í°²×°µÄSQL ServerµÄ°æ±¾ÁË¡£¶ÔÓ¦ÒÔϵıí¸ñ£¬¿ÉÒÔ²é³öÀ´¾ßÌå¶ÔÓ¦µÄ²¹¶¡°æ±¾¡£8.00.2039±íʾ°²×°ÁËSP4£¬8.00.760±íʾ°²×°ÁËSP3¡£
µÚ¶þ²½£º¶ÔÕÕ±í¸ñ²éÕÒ¾ßÌåµÄ²¹¶¡°æ±¾
SQL Server Versions
@Version SQL Server Version Released
6.50.201 SQL Server 6.5 RTM
6.50.213 SQL Server 6.5 with Service Pack 1
6.50.240 SQL Server 6.5 with Service Pack 2
6.50.258 SQL Server 6.5 with Service Pack 3
6.50.281 SQL Server 6.5 with Service Pack 4
6.50.415 SQL Server 6.5 with Service Pack 5
6.50.416 SQL Server 6.5 with Service Pack 5a
7.00.623 SQL Server 7.0 / MSDE 1.0 RTM
7.00.699 SQL Server 7.0 SP1 July 1999
7.00.842 SQL Server 7.0 SP2 March 20th, 2000
7.00.961 SQL Server 7.0 SP3 December 15th, 2000
7.00.1063 SQL Server 7.0 SP4
8.00.194 SQL Server 2000 RTM
8.00.384 SQL Server 2000 SP1
8.00.534 SQL Server 2000 SP2 November 30th, 2001
8.00.760 SQL Server 2000 SP3
8.00.2039 SQL Server 2000 SP4
¸ü¶àµÄ°æ±¾¶ÔÕÕ±í£º
For SQL Server 8
Main Releases
@@version Version and Service Pack
8.00.2039 Service Pack 4
8.00.760 Service Pack 3
8.00.534 Service Pack 2
8.00.384 Service Pack 1
8.00.194 RTM
All Releases
@@version Version and Service Pack
8.00.2039 Se


Ïà¹ØÎĵµ£º

sqlÓï¾ä£¬È¡³ö±íAÖеĵÚ31Ìõµ½40Ìõ¼Ç¼

 sqlÓï¾ä£¬È¡³ö±íAÖеĵÚ31Ìõµ½40Ìõ¼Ç¼£¨±íAÒÔ×Ô¶¯Ôö³¤µÄID×öÖ÷¼ü£¬×¢ÒâID¿ÉÄÜÊDz»Á¬ÐøµÄ£©
-->select top 10 * from a where id not in (select top 30 id from a order by id) order by id
    ²éѯǰʮÌõ¼Ç¼£¬µ«Ìõ¼þÊÇ£ºID²»ÔÚÇ°ÈýÊ®ÌõµÄIDÀïÃæ
-->select top 10 * from (select top 40 ......

SQLÈÕÆÚºÍʱ¼äº¯Êý

 
--»ùÓÚʱ¼äSQLº¯Êý--
getdate() --·µ»Øµ±Ç°ÏµÍ³ÈÕÆÚºÍʱ¼ä¡£
DateAdd --ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ¡£
DATEADD ( datepart , number, date )
--Àý£ºÏòµ±ÌìµÄʱ¼äÔö¼Ó5Ìì
select dateadd(dd,5,getdate())
datediff --·µ»Ø¿çÁ½¸öÖ¸¶¨ÈÕÆÚµÄÈÕÆÚºÍʱ¼ä±ß½çÊý¡£]
---ÀýÈç
 & ......

DB2ÁÙʱ±íÔÚSQL¹ý³Ì

 
°æȨÉùÃ÷£ºÔ­´´×÷Æ·£¬ÈçÐèתÔØ£¬ÇëÓë×÷ÕßÁªÏµ¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£
DB2ÁÙʱ±íÔÚSQL¹ý³ÌºÍSQLÓï¾äÖеIJâÊÔ×ܽá
 
²âÊÔÄ¿±ê£º
 
·Ö±ðÔÚSQL¹ý³ÌºÍSQLÓï¾äÖд´½¨ÁÙʱ±í£¬²¢²åÈëÊý¾Ý£¬¿´Ö´Ðнá¹ûÓÐʲôÒìͬ¡£
 
²âÊÔ»·¾³£º
 
DB2 UDB V9.1
 
Ö´Ðи½¼þÀïÃæµÄSQLÓï¾ä£¬µÃµ½Ò»¸ö±í¡ ......

SQLν´Ê

1¡¢Î½´Ê ν´ÊÔÊÐíÄú¹¹ÔìÌõ¼þ£¬ÒÔ±ãÖ»´¦ÀíÂú×ãÕâЩÌõ¼þµÄÄÇЩÐС£
2¡¢Ê¹Óà IN ν´Ê
ʹÓà IN ν´Ê½«Ò»¸öÖµÓëÆäËû¼¸¸öÖµ½øÐбȽϡ£ÀýÈ磺
SELECT NAME from STAFF WHERE DEPT IN (20, 15)
´ËʾÀýÏ൱ÓÚ£º
SELECT NAME from STAFF WHERE DEPT = 20 OR DEPT = 15
µ±×Ó²éѯ·µ»ØÒ»×éֵʱ£¬¿ÉʹÓà IN ºÍ NOT IN ÔËËã·û¡£ÀýÈç£ ......

sql 2005 ·ÖÒ³£¬ÅÅÃûº¯Êý

 WITH V AS(SELECT ROW_NUMBER() OVER(order by fcustid desc) AS RN,*  from  ts_dict AS SourceView)
SELECT * from V WHERE RN BETWEEN 1 AND 10
תÔصØÖ·£ºhttp://www.cnblogs.com/nokiaguy/archive/2009/02/05/1384860.html
ÅÅÃûº¯ÊýÊÇSQL Server2005мӵŦÄÜ¡£ÔÚSQL Server2005ÖÐÓÐÈçÏÂËĸöÅÅÃûº ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ