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

SqlServerÖвéѯ10µ½20ÌõÖ®¼äµÄÊý¾Ý

 ²éѯnorthwindÊý¾Ý¿âÖÐordersÖеÄ10µ½20Ìõ¼Ç¼
select   top   10   *   from   orders
 where   orderid > ( select  max(orderid)  from  (select top 10 orderid  from  orders order by orderid) as t  )
orders±íÖÐÒÑÓÐ×ÔÔö³¤µÄ±êʶÁÐorderid,
ÏȲé³ö±íÖÐǰʮÌõ¼Ç¼ÖеÄ×î´óorderid£¬
10ÌõÒÔºóµÄorderid¿Ï¶¨´óÓÚǰʮÌõµÄ×î´óid£¬ËùÒÔÔÙwhereÅжϼ´¿É¡£
ÁíÍ⣬Èç¹ûÒª²éѯµÄ±íûÓбêʶÁУ¬Ò²¿ÉÒÔʹÓÃÏÂÃæÕâÖÖ·½·¨£º
select   top 20 identity(int ,1,1) as id *   into  #temp  from  table
select  *  from   #temp  where  id>10


Ïà¹ØÎĵµ£º

SQLServer½«ÈÕÆÚת»»³É×Ö·û´®¸ñʽ

 SELECT   convert(char,ÈÕÆÚ×Ö¶Î,120)   as   date2   from   table
mssqlĬÈÏÒÔϵͳʱ¼ä¸ñʽÊä³ö£¬Äã¿ÉÒÔµ÷ÕûϵͳµÄʱ¼ä¸ñʽÀ´½â¾ö
µ±È»ÊÇÔÚ³ÌÐòÀï½â¾ö±È½ÏÁé»î£¬convert(char,date,N)Êä³öµÄ¸÷ÖÖÑùʽ
N   ÈÕÆÚÑùʽ  
0   04& ......

SQLServerÖÐÁÙʱ±íµÄÒ»ÔòʹÓÃ

1.SQLServerµÄ´´½¨½Å±¾ÈçÏ£º
USE [master]
GO
/****** Object:  Database [test]    Script Date: 10/29/2009 17:43:10 ******/
CREATE DATABASE [test] ON  PRIMARY
( NAME = N'test', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\test.mdf' , S ......

Óû§"sa "µÇ½ʧ°Ü SQLServer ´íÎó18456

 ÓÃwindowsÕ˺ݹÊÇ¿ÉÒԵǼµÄ¡£
²éÕÒÎÊÌâµÄ¹ý³Ì£º
µÚÒ»²½£º Æô¶¯ËùÓÐÓëSQLÓйصķþÎñ£¬ÎÊÌâÒÀ¾É£»
µÚ¶þ²½£º ²é¿´windows·À»ðǽ£¬±»Ä¬ÈÏÆô¶¯ÁË£¬²»Æô¶¯Ñ¡ÔñÏî±»Disabled¡£Á½¸öÌáʾ“ÓÉÓÚ°²È«¿¼ÂÇ,ijЩÉèÖÃÓÉ×é²ßÂÔ¿ØÖÆ”“Windows·À»ðǽÕýÔÚʹÓÃÄúµÄÓòÉèÖÔ£¬ÏÈÓÃgpedit.msc´ò×é²ßÂԱ༭Æ÷£¬» ......

ΪSQLServer±íÖеÄ×Ö¶ÎÌí¼Ó˵Ã÷

ÔÚSQLÓï¾äÖÐͨ¹ýϵͳ´æ´¢¹ýsp_addextendedproperty¿ÉΪ±í×Ö¶ÎÌí¼ÓÉ϶¯Ì¬µÄ˵Ã÷£¨±¸×¢£©ÏÂÃæÊÇSQL SERVER°ïÖúÎĵµÖжÔsp_addextendedproperty´æ´¢¹ý³ÌµÄÃèÊö
Óï·¨
sp_addextendedproperty
    [ @name = ] { 'property_name' }
    [ , [ @value = ] { 'value' }
   &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ