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

mysqlµÄ´óÅúÁ¿µ¼ÈëÊý¾ÝsqlÓï¾äµÄÒ»µãÓÅ»¯

´óÅúÁ¿²åÈëÊý¾Ýʱ 1,myisam±í,¿ÉÒÔÏÈͨ¹ý alter table table_name disable keys;#ÏȹرձíµÄË÷Òý¼ì²é,×¢ÒâÊÇ·ÇΨһË÷Òý! load data infile ¡®/path/file¡¯ into table table_name; alter table table_name anable keys;#ÔÙ´ò¿ªË÷Òý ¿É´ó´ó¼Ó¿ìµ¼Èë.»¹ÓпÉÒÔÉèÖÃbulk_insert_buffer_sizeÖµÀ´Ìá¸ß²åÈëËÙ¶È 2,innodb±í,ÉÏÃæ·½·¨²»Ôõô´ÕЧ ¿ÉÒÔ¶ÔÊý¾Ý°´Ö÷¼ü½øÐÐÅÅÐò,ÒòΪinnodbÊÇ°´Ö÷¼ü˳Ðò±£´æÊý¾ÝµÄ;ÔÚµ¼ÈëÊý¾Ý֮ǰ¿ÉÒÔÏȹرÕΨһË÷ÒýЧÑé set unique_checks=0; Èç¹ûÓÐ×Ô¶¯Ìá½»,ÏÈ¹Ø±Õ set autocommit=0;


Ïà¹ØÎĵµ£º

¹ØÓÚSQL ServerËÀËø

transaction 1:
------------------------------------------------------
 begin transaction
  update table1 set cola = 'str1'
  Waitfor time '10:12:00'
  update table2 set colb = 'str2'
 rollback transaction
 
transaction 2:
---- ......

sql ÈÕÆڱȽÏ

sql ºÜ¾Ã²»Óã¬Í»È»¼äÒªÇó×ö±¨±í¡£ËùÒÔÓÖ¿ÉÒÔ²¹Ò»²¹sql֪ʶÁË¡£µ«¾­³£»áÓöµ½Ò»Ð©ÈõÖÇÎÊÌâ.
дÁËÒ»Ìõsql£ºselect to_date('2009-09-24 12:20:0') Äܽ«¸Ä×Ö·û´®×ª»»ÎªÈÕÆÚ
µ«ÁíÍâÒ»Ìõsqlȴת»»²»ÁË...¸Ð¾õºÜÆæ¹Ö.ÓÚÊǺõ¡£ÔÙ×Ðϸ¿´Ò»±é ·¢ÏÖ
¸øÒ»¸öÈÕÆÚ×Ö¶ÎÉèÖñðÃûʱÉèÖóÉÁËsib.fbizDate as dateÎÒ×Ô¼º¶¼ÎÞÓïÁË¡£Ôõô»áÉè ......

SQLÓÅ»¯½éÉÜÒ»

Ò»¡¢Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)
 
ORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû,Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí. ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í.µ±ORACLE´¦Àí¶à¸ö±íʱ, »áÔËÓÃÅÅÐò¼°ºÏ²¢µÄ·½Ê½Á¬½ÓËüÃÇ ......

sql server ÖÐÁÙʱ±íÓë±í±äÁ¿µÄÇø±ð

 
ÎÒÃÇÔÚÊý¾Ý¿âÖÐʹÓñíµÄʱºò,¾­³£»áÓöµ½Á½ÖÖʹÓñíµÄ·½·¨,·Ö±ð¾ÍÊÇʹÓÃÁÙʱ±í¼°±í±äÁ¿¡£ÔÚʵ¼ÊʹÓõÄʱºò£¬ÎÒÃÇÈçºÎÁé»îµÄÔÚ´æ´¢¹ý³ÌÖÐÔËÓÃËüÃÇ£¬ËäÈ»ËüÃÇʵÏֵŦÄÜ»ù±¾ÉÏÊÇÒ»ÑùµÄ£¬¿ÉÈçºÎÔÚÒ»¸ö´æ´¢¹ý³ÌÖÐÓÐʱºòȥʹÓÃÁÙʱ±í¶ø²»Ê¹Óñí±äÁ¿£¬ÓÐʱºòȥʹÓñí±äÁ¿¶ø²»Ê¹ÓÃÁÙʱ±íÄØ?
¡¡¡¡ÁÙʱ±í
¡¡¡¡ÁÙʱ±íÓëÓÀ¾Ã± ......

ÈçºÎÓÃSQLÓï¾äÔÚÁ½¸öÊý¾Ý¿â¼ä¸´ÖÆ´æ´¢¹ý³Ì

 --1.ÔÚÄ¿±ê·þÎñÆ÷ÉϽ¨Á¢Èç϶ÔÏó(±»Í¬²½µÄ·þÎñÆ÷)  
   
  if   exists   (select   *   from   dbo.sysobjects   where   id   =   object_id(N'[sys_syscomments_bak]')   and   OBJECTPROPERTY(id,   N'IsUserTable')   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ