SQL´¥·¢Æ÷
Ò»¸ö¼òµ¥µÄСʵÀý¾ÍÃ÷°×~£¡
user±í
ÔÚÕâÕűíÖн¨Á¢´¥·¢Æ÷
Create trigger tiggername
on user
for delete
as
begin
delete from user2
end;
µ±É¾³ý±íuserÖеÄijһ¼Ç¼ʱ£¬user2±íÀïµÄÊý¾ÝÈ«²¿É¾³ý~£¡
Èç¹ûҪɾ³ý´¥·¢Æ÷£¬Ö»ÒªÔÚUser±íµÄ´¥·¢Æ÷ÄÚ£¬Ñ¡ÖÐtiggername ´¥·¢Æ÷Ãû£¬É¾³ý¼´¿É¡£
´¥·¢Æ÷²»ÐèÒªµ÷Óã¬Ö»ÐèҪѡÖУ¬Ö´ÐÐ ¼´¿É..............
Ïà¹ØÎĵµ£º
1.»ñÈ¡ËùÓÐÊý¾Ý¿âÃû:
SELECT Name from Master..SysDatabases ORDER BY Name
2.»ñÈ¡ËùÓбíÃû:
SELECT Name from DatabaseName..SysObjects Where XType='U' ORDER BY Name
XType='U':±íʾËùÓÐÓû§±í;
XType='S':±íʾËùÓÐϵͳ±í;
3.»ñÈ¡ËùÓÐ×Ö¶ÎÃû:
SELECT Name from SysColumns WHERE id=Object_Id('TableNam ......
°ÑOldÊý¾Ý¿â¸ÄΪNewÊý¾Ý¿â
1.´ò¿ª“ÆóÒµ¹ÜÀíÆ÷”ÕÒµ½ OldÊý¾Ý¿â££¡·ÓÒ¼ü££¡·ËùÓÐÈÎÎñ££¡··ÖÀëÊý¾Ý¿â
2.µ½C:\Program Files\Microsoft SQL Server\MSSQL\DataÏÂÕÒµ½Old_Data.mdfºÍOld_log.ldf°ÑOld_Data»»³ÉÄãÏëÒªµÄÃû×ÖÀýÈçNew.mdf¡¢New.ldf
3.µ½ÆóÒµ¹ÜÀíÆ÷£¬ÕÒµ½ Êý¾Ý¿â ££¡·ÓÒ¼ü££¡·ËùÓÐÈÎÎñ££¡ ......
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
¡¡¡¡SQL·ÖÀࣺ
¡¡¡¡DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
¡¡¡¡DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
¡¡¡¡DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
¡¡¡¡Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
¡¡¡¡1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
......
ʲôÊÇPL/SQL
PL/SQL(Procedural Language/SQL,¹ý³Ì»¯SQLÓïÑÔ£©ÊÇOracle¹«Ë¾ÔÚ±ê×¼SQLÓïÑԵĻù´¡ÉÏ·¢Õ¹µÄÓïÑÔ£¬Ëü½«±äÁ¿¡¢¿ØÖƽṹ¡¢¹ý³ÌºÍº¯ÊýµÈ½á¹¹»¯³ÌÐòÉè¼ÆµÄÒªËØÒýÈëSQLÓïÑÔ£¬´Ó¶øÄܹ»±àÖƱȽϸ´ÔÓµÄSQL³ÌÐò£»ÀûÓÃPL/SQLÓïÑÔ±àдµÄ³ÌÐò³ÆΪPL/SQL³ÌÐò¿é£¬ÆäÖ÷ÒªÌصãÈçÏ£º
¾ßÓÐÄ£¿é»¯µÄ½á¹¹
ʹÓùý³Ì»¯ÓïÑÔ¿ØÖƽ ......
ÊÂÎñÊÇOracle9iÖнøÐÐÊý¾Ý¿â²Ù×÷µÄ»ù±¾µ¥Î»£¬ÔÚPL/SQL³ÌÐòÖУ¬¿ÉÒÔʹÓÃ3¸öÊÂÎñ´¦Àí¿ØÖÆÃüÁî¡£
1. commitÃüÁî
commitÊÇÊÂÎñÌá½»ÃüÁî¡£Oracle9iÊý¾Ý¿âÖУ¬Îª±£Ö¤Êý¾ÝÒ»ÖÂÐÔ£¬ÔÚÄÚ´æÖÐΪÿ¸ö¿Í»§»ú½¨Á¢¹¤×÷Çø£¬¿Í»§»ú¶ÔÊý¾Ý¿â½øÐвÙ×÷µÄÊÂÎñ¶¼ÔÚ¹¤×÷ÇøÍê³É£¬Ö»ÓÐÖ´ÐÐcommitÃüÁîºó£¬¹¤×÷ÇøÄÚµÄÐÞ¸ÄÄÚÈݲÅдÈëµ½Êý¾Ý¿âÉÏ£¬³Æ ......