SQL Server ¿É¸üж©ÔÄÊÂÎñ¸´ÖƵÄtrigger´¦Àí
1. Ïû³ýtriggerµÄǶÌ×µ÷Óá£×îºÃ²»ÒªÓà EXEC sp_configure 'nested triggers', '0'£¬ Ó¦¸ÃÔÚtriggerÖÐʹÓÃÅжÏÓï¾ä£¬ ÀýÈ磺if not update (name) return¡£
2. ʹÓà not for replication ½ûÖ¹ÔÚ¸´ÖƵÄʱºò´¥·¢trigger¡£
3. ´´½¨publisher articleµÄʱºò£¬ ÉèÖà copy user triggersΪ true¡£
ÕâÑù±£Ö¤£ºtrigger²»»áǶÌ×µ÷Ó㻸´ÖƲ»»á´¥·¢trigger£»¶øÇÒpublisher ºÍ subscriberÉ϶¼»áÓд¥·¢Æ÷£¬ ÕâÑùtriggerµÄÖ´Ðнá¹û»áʵʱµÃ·´Ó³µ½µ±Ç°½Úµã²¢»á¸´ÖƵ½ÆäËû½Úµã¡£
Àý£º
CREATE TRIGGER [trg_testtable] on [dbo].[testtable]
for insert,update
not for replication
AS
if not update (name) return
update testtable set anum = dbo.fn_GetOrderString(name) WHERE id in (select id from inserted)
Ïà¹ØÎĵµ£º
ÄÚÈÝת×Ô£ºhttp://david.btbbt.blog.163.com/blog/static/205989372009973357418/
µÇ¼Զ³ÌSQL·þÎñÆ÷
Ò» ¿´ping ·þÎñÆ÷IPÄÜ·ñpingͨ¡£
¡¡¡¡Õâ¸öʵ¼ÊÉÏÊÇ¿´ºÍÔ¶³Ìsql server 2000·þÎñÆ÷µÄÎïÀíÁ¬½ÓÊÇ·ñ´æÔÚ¡£Èç¹û²»ÐУ¬Çë¼ì²éÍøÂ磬²é¿´ÅäÖ㬵±È»µÃÈ·±£Ô¶³Ìsql server 2000·þÎñÆ÷µÄIPƴдÕýÈ·¡£
¡¡¡¡¶þ ÔÚDos»òÃüÁîÐÐ ......
ת×Ô£ºhttp://topic.csdn.net/u/20100109/09/70f82fb7-eabc-4140-9573-5f8395e0f62e.html
²éѯËÙ¶ÈÂýµÄÔÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ£º
¡¡¡¡1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
¡¡¡¡2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
¡¡¡¡3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
¡¡¡¡4¡¢ÄÚ´æ²»×ã
¡¡¡ ......
sqlºËÐÄÓï¾ä(·Ç³£ÊµÓõļ¸¸ö¼¼ÇÉ)²åÈëÊý¾Ý
Ïò±íÖÐÌí¼ÓÒ»¸öмǼ£¬ÄãҪʹÓà sql INSERT Óï¾ä¡£ÕâÀïÓÐÒ»¸öÈçºÎʹÓÃÕâÖÖÓï¾äµÄÀý×Ó£º
INSERT mytable (mycolumn ......
½ñÌìÔÚ´¦ÀíÒ»¸öÓû§ÃûÊý¾Ý¿âʱ£¬·¢ÏÖÓÐЩ²»Õý³£µÄÊý¾Ý´æÔÚ£¬°´ÕÕÂß¼£¬Óû§ÃûÖ»ÄÜÊÇÊý×Ö£¬×Öĸ£¬Ï»®Ïߺʹ¿ÖÐÎÄÕâÑùµÄ×Ö·û×éºÏ´æÔÚ£¬²»Ó¦¸ÃÓÐÆäËû×éºÏ´æÔÚ£¬µ«ÊÇ·¢ÏÖÊý¾Ý¿âÖÐÓÉÓÚ¸÷ÖÖÀúÊ·ÔÒò£¬ÓÐЩ²»Õý³£µÄ´æÔÚ£¬ÈçºÎÕÒµ½ÕâЩÒì³£Êý¾Ý£¬ÔÚCSDNµÄ SQL Server °æÎÊÁËÕâÑùÁ½¸öÎÊÌ⣬ÈçÏ£º http://topic.csdn.net/u/20100111 ......
a.Êý¾Ý¿â»ù´¡
i.¸ÅÄ±í¼°Ïà¹Ø²Ù×÷¶ÔÏóµÄ¼¯ºÏ£¨Ö÷Êý¾ÝÎļþmdf£¬¶þ¼¶Êý¾ÝÎļþndf£¬ÈÕÖ¾ldf£©
ii.×é³É£ºÏµÍ³£º master(¼Ç¼ÁËËùÓеķþÎñÆ÷ϵͳÐÅÏ¢)
,model£¨¼Ç¼ÁËËùÓÐÁÙʱ¼Ç¼£¬Á´½Ó¶Ï¿ªÊ±£¬Êý¾Ý¶ªÊ§£©
Tempdb£¨Êý¾ÝÄ£°å¿â£¬º¬´´½¨¿âʱµÄȱʡÊý¾Ý£©
, ......