SqlServer´¥·¢Æ÷Óï·¨¼ÇÒä
CREATE TRIGGER trigger_name
ON { table | view }
[ WITH ENCRYPTION ]
{
{ { FOR | AFTER | INSTEAD OF } { [ INSERT ] [ , ] [ UPDATE ] }
[ WITH APPEND ]
[ NOT FOR REPLICATION ]
AS
[ { IF UPDATE ( column )
[ { AND | OR } UPDATE ( column ) ]
[ ...n ]
| IF ( COLUMNS_UPDATED ( ) { bitwise_operator } updated_bitmask )
{ comparison_operator } column_bitmask [ ...n ]
} ]
sql_statement [ ...n ]
&nbs
Ïà¹ØÎĵµ£º
Ò»¡¢Ö÷¼üÓë¾Û¼¯Ë÷Òý²¢²»ÊÇÒ»¶ÔһƥÅäµÄ
Ò»°ãÇé¿öÏÂÎÒÃǶ¼ÈÏΪ,¾Û¼¯Ë÷ÒýºÍÖ÷¼üÊÇÏ໥ƥÅäµÄ,ÒòΪֻҪÄãÔÚSQLServer±íÖж¨ÒåÁËÒ»¸öÖ÷¼ü,ÄÇôSQLServer»áΪÕâ¸öÖ÷¼ü×Ô¶¯Ìí¼Ó¾Û¼¯Ë÷Òý.µ«ÊÇ,Èç¹ûÄãÏÈÔÚ±íÖлùÓÚÈÎÒâÒ»Áн¨Á¢¾Û¼¯Ë÷Òý,È»ºóÔÙÑ¡ÔñÁíÒ»ÁÐ×÷ΪÖ÷¼ü,Õâʱ,Õâ¸öSQLServer½«»á»ùÓÚÕâ¸öÖ÷¼ü½¨Á¢Ò»¸öΨһ·Ç¾Û¼¯Ë÷Òý.
¶þ¡¢ ......
--(¿ªÆôSQL·þÎñ£ºnet start mssqlserver)
--(ÔÚÃüÁîÐÐÖÐÊäÈë'sqlwb'ÃüÁî¿É´ò¿ªSQL¹ÜÀíÆ÷ )
--(Èç¹ûÒªÖ´ÐжàÌõÃüÁîÖеÄÒ»Ìõ,Êó±êÑ¡¶¨ºóÔÙ°´F5Ö´ÐÐ)
create database sales & ......
SQLServerʱ¼äÈÕÆÚº¯ÊýÏê½â,SQLServer,ʱ¼äÈÕÆÚ,
1. µ±Ç°ÏµÍ³ÈÕÆÚ¡¢Ê±¼ä
select getdate()
2. dateadd ÔÚÏòÖ¸¶¨ÈÕÆÚ¼ÓÉÏÒ»¶Îʱ¼äµÄ»ù´¡ÉÏ£¬·µ»ØÐ嵀 datetime Öµ
À ......
×òÌìÏÂÎç¿ìÏ°àµÄʱºò£¬ÎÞÒâÖÐÌýµ½¹«Ë¾Á½Î»Í¬ÊÂÔÚ̽ÌÖÅúÁ¿ÏòÊý¾Ý¿â²åÈëÊý¾ÝµÄÐÔÄÜÓÅ»¯ÎÊÌ⣬¶ÙʱÀ´ÁËÐËȤ£¬°Ñ×Ô¼ºµÄÏë·¨ÏòÁ½Î»Í¬ÊÂ˵ÁËһϣ¬ÓÚÊÇÓÐÁ˱¾ÎÄ¡£
¹«Ë¾¼¼Êõ±³¾°£ºÊý¾Ý¿â·ÃÎÊÀࣨxxx.DataBase.Dll£©µ÷Óô洢¹ý³ÌʵÏÖÊý¾Ý¿âµÄ·ÃÎÊ¡£
¼¼Êõ·½°¸Ò»£º
ѹËõʱ¼äϳÌÐòԱд³öµÄµÚÒ»¸ö°æ±¾£¬½ö½öΪÁËÍê³ÉÈÎÎñ£¬Ã»ÓÐ´Ó³Ì ......
SQLServerºÍOracleµÄ³£Óú¯Êý¶Ô±È
1.¾ø¶ÔÖµ
S:select abs(-1) value
O:select abs(-1) value from dual
2.È¡Õû(´ó)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.È¡Õû£¨Ð¡£©
S:select floor(-1.001) value
O:select floor(-1.001) value from dual ......