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

SQL 2005 Tips Bulk data transfer sample‏

CREATE PROC [dbo].[UP_EC_JOB_UpdateAddressType] 

 @Count INT  

AS 
BEGIN 
 
 SET NOCOUNT ON 
  
 DECLARE @TransactionNumber INT  
 DECLARE @Cursor CURSOR  
 
 SET @Cursor = CURSOR  LOCAL STATIC FORWARD_ONLY READ_ONLY 
 FOR  
  SELECT TOP(@Count) TransactionNumber  
    from dbo.CustomerShippingInfo WITH(NOLOCK)  
  WHERE AddressType IS NULL 
  
 OPEN @Cursor 
 FETCH NEXT from @Cursor INTO @TransactionNumber 
 WHILE (@@FETCH_STATUS = 0) 
  BEGIN          
   UPDATE dbo.CustomerShippingInfo 
   SET AddressType = 1 
   WHERE TransactionNumber = @TransactionNumber 
 
   FETCH NEXT from @Cursor INTO @TransactionNumber 
  END 
 
 CLOSE @Cursor 
 DEALLOCATE @Cursor  
END


Ïà¹ØÎĵµ£º

[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Ò»)

±¾ÏµÁÐÎÄÕµ¼º½
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Ò»)--sum()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(¶þ)--max()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Èý)--row_number() /rank()/dense_rank()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(ËÄ)--lag()/lead()
ʵ¼ÊÓ¦ÓÃÖÐÎÒÃÇ¿ÉÒÔͨ¹ýsum()ͳ¼Æ³ö×éÖеÄ×ܼƻòÕßÊÇÀÛ¼ÓÖµ£¬¾ßÌåʾÀýÈçÏ£º
......

[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Èý)

±¾ÏµÁÐÎÄÕµ¼º½
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Ò»)--sum()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(¶þ)--max()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(Èý)--row_number() /rank()/dense_rank()
[Oracle]¸ßЧµÄSQLÓï¾äÖ®·ÖÎöº¯Êý(ËÄ)--lag()/lead()
ÓÐЩʱºòÎÒÃÇÏ£ÍûµÃµ½Ö¸¶¨Êý¾ÝÖеÄÇ°nÁУ¬Ê¾ÀýÈçÏ£º
µÃµ½Ã¿¸ö²¿ÃÅнˮ×î¸ßµÄ ......

DB2 SQL ¾«Òª £¨³ÖÐø¸üÐÂÖÐ.......£©

----start
      ·²ÊÇÖªµÀÊý¾Ý¿âµÄÈ˶¼ÖªµÀSQL£¬·²ÊǶÔSQLÓÐÒ»µãÁ˽âµÄÈ˶¼¾õµÃSQLºÜ¼òµ¥£¬·²ÊÇÓÐÕâÖָоõµÄÈ˶¼ÊÇSQLµÃ³õ¼¶Óû§£¬ÒòΪËûѧ»áÁËÔö²éɾ¸Ä¾ÍÒÔΪÕâ¾ÍÊÇSQLµÄÈ«²¿¡£Ä¿Ç°µÄ´ó²¿·ÖÓ¦ÓÃÈí¼þ¶¼ÊÇÒÔÊý¾Ý¿âΪÖÐÐÄ£¬Ëæ×ÅÈí¼þµÄÔËÐУ¬Êý¾ÝÁ¿»áÔ½À´Ô½´ó¡£ÈçºÎÓüò½à¡¢¸ßЧµÄSQLÓï¾ä²Ù×÷Êý¾ÝÏÔµÃÔ½À ......

SQL 2005 tips

USE tempdb
GO
CREATE TABLE AuctionItems
(
  itemid       INT          NOT NULL PRIMARY KEY NONCLUSTERED,
  itemtype     NVARCHAR(30) NOT NULL,
  whenmade     INT&nb ......

Sql Server µÈ´ý״̬˵Ã÷

µÈ´ýÀàÐÍ  ˵Ã÷  
ASYNC_DISKPOOL_LOCK 
µ±³¢ÊÔͬ²½²¢ÐеÄỊ̈߳¨Ö´Ðд´½¨»ò³õʼ»¯ÎļþµÈÈÎÎñ£©Ê±³öÏÖ¡£ 
ASYNC_IO_COMPLETION 
µ±Ä³ÈÎÎñÕýÔڵȴý I/O Íê³Éʱ³öÏÖ¡£ 
ASYNC_NETWORK_IO 
µ±ÈÎÎñ±»×èÖ¹ÔÚÍøÂçÖ®ºóʱ³öÏÖÔÚÍøÂçдÈëÖС£ 
BACKUP 
µ±ÈÎÎñ×÷Ϊ±¸·Ý´¦Àí ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ