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

SQL È¡nµ½mÌõ¼Ç¼

1.
select   top   m   *   from   tablename   where   id   not   in   (select   top   n   id   from   tablename)
2.
select   top   m   *   into   ÁÙʱ±í(»ò±í±äÁ¿)   from   tablename   order   by   columnname   --   ½«top   m±Ê²åÈë
set   rowcount   n
select   *   from   ±í±äÁ¿   order   by   columnname   desc
3.
select   top   n   *   from  
(select   top   m   *   from   tablename   order   by   columnname)   a
order   by   columnname   desc
4.Èç¹ûtablenameÀïûÓÐÆäËûidentityÁУ¬ÄÇô£º
select   identity(int)   id0,*   into   #temp   from   tablename
È¡nµ½mÌõµÄÓï¾äΪ£º
select   *   from   #temp   where   id0   >=n   and   id0   <=   m
Èç¹ûÄãÔÚÖ´ÐÐselect   identity(int)   id0,*   into   #temp   from   tablenameÕâÌõÓï¾äµÄʱºò±¨´í,ÄÇÊÇÒòΪÄãµÄDBÖмäµÄselect   into/bulkcopyÊôÐÔûÓдò¿ªÒªÏÈÖ´ÐУº
exec   sp_dboption   ÄãµÄDBÃû×Ö, "select   into/bulkcopy ",true
5.Èç¹û±íÀïÓÐidentityÊôÐÔ£¬ÄÇô¼òµ¥£º
select   *   from   tablename   where   identitycol   between   n   and   m  
±ÈÈçÒ»¸ö±íÓÐ100Ìõ¼Ç¼ÔõôȡÆäÖеĵÚ30ÖÁµÚ40Ìõ¼Ç¼??
select &nbs


Ïà¹ØÎĵµ£º

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

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

Top 10 Features of SQL 2008 R2

Introduction
Microsoft SQL Server 2008 R2 is the latest release of SQL Server. This article will introduce the top 10 features and benefits of SQL Server 2008 R2. The “R2” tag indicates this is an intermediate release of SQL Server and not a major revision. However, there are a number o ......

SQL ServerÖд洢¹ý³ÌÓ뺯ÊýµÄÇø±ð

SQL ServerÓû§×Ô¶¨Ò庯ÊýºÍ´æ´¢¹ý³ÌÓÐÀàËƵŦÄÜ£¬¶¼¿ÉÒÔ´´½¨À¦°óSQLÓï¾ä£¬´æ´¢ÔÚserverÖй©ÒÔºóʹÓá£ÕâÑùÄܹ»¼«´óµØÌá¸ß¹¤×÷ЧÂÊ£¬Í¨¹ýÒÔϵĸ÷ÖÖ×ö·¨¿ÉÒÔ¼õÉÙ±à³ÌËùÐèµÄʱ¼ä£º
¡¡¡¡ 1 Öظ´Ê¹Óñà³Ì´úÂ룬¼õÉÙ±à³Ì¿ª·¢Ê±¼ä¡£
¡¡¡¡ 2 Òþ²ØSQLϸ½Ú£¬°ÑSQL·±ËöµÄ¹¤×÷Áô¸øÊý¾Ý¿â¿ª·¢ÈËÔ±£¬¶ø³ÌÐò¿ª·¢Ô±Ôò¼¯Öд¦Àí¸ß¼¶±à³Ì ......

SQL Server±¸·ÝÊÂÎñÈÕÖ¾½áβ(Tail)

ÊÂÎñÈÕÖ¾½áβ¾­³£Ìá½»Êý¾Ý¿âδ±¸·ÝµÄÊÂÎñÈÕÖ¾ÄÚÈÝ¡£»ù±¾ÉÏ£¬Ã¿Ò»´ÎÄãÖ´ÐÐÊÂÎñÈÕÖ¾±¸·Ýʱ£¬Ä㶼ÔÚÖ´ÐÐÊÂÎñÈÕÖ¾½áβµÄ±¸·Ý¡£
ÄÇΪʲô»áÕâôÉè¼ÆÄØ£¿ÒòΪҲÐíÓÉÓÚ½éÖʵÄË𻵣¬µ±Êý¾Ý¿âÒѾ­²»ÔÙ¿ÉÓÃʱ£¬Âé·³¾ÍÀ´ÁË¡£Èç¹ûÏÂÒ»¸öÂß¼­²½ÖèÕýºÃ¾ÍÊÇÒª±¸·Ýµ±Ç°ÊÂÎñÈÕÖ¾µÄ»°£¬¿ÉÒÔÓ¦ÓÃÕâ¸ö±¸·ÝÀ´Ê¹Êý¾Ý¿â´¦Óڵȴý(Standby)״̬¡£ÄãÉ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ