СµÜÒªÓÃc# ×ö¸öС¹¤¾ß£¬¾ÍÊǸøÊý¾Ý¿âÖеıí¸ñÅúÁ¿²åÈëÊý¾Ý£¬ÎÒÏ뾡Á¿·ûºÏ±í½á¹¹¹ØϵµÄÊý¾Ý²åÈë½üÀ´£¬ ±ÈÈçÒª¿¼ÂÇÖ÷Í⽡µÈÐÅÏ¢£¬±È·½Ëµ ÓÐ a b c dÈý¸ö±í£¬¶øÎÒÈçºÎÔÚÊý¾Ý¿âÖÐÈ·ÈÏÖ÷¼üºÍÍâ¼ü£¬µ½µ×¸ÃÈçºÎÈ·ÈϲåÈë˳ÐòÄØ ÇëÎʸ÷λ¸ßÊÖ¸øÖ¸µãÃÔ½ò~ SQL code: --²éѯһ¸ö±íµÄËùÓÐÍâ¼ü:
SELECT Ö÷¼üÁÐID=b.rkey ,Ö÷¼üÁÐÃû=(SELECT name from syscolumns WHERE colid=b.rkey AND id=b.rkeyid) ,Íâ¼ü±íID=b.fkeyid ,Íâ¼ü±íÃû³Æ=object_name(b.fkeyid) ,Íâ¼üÁÐID=b.fkey ,Íâ¼üÁÐÃû=(SELECT name from syscolumns WHERE colid=b.fkey AND id=b.fkeyid) ,¼¶Áª¸üÐÂ=ObjectProperty(a.id,'CnstIsUpdateCascade') ,¼¶ÁªÉ¾³ý=ObjectProperty(a.id,'CnstIsDeleteCascade') from sysobjects a join sysforeignkeys b on a.id=b.constid join sysobjects c on a.parent_obj=c.id where a.xtype='f' AND c.xtype='U' and object_name(b.rkeyid)='tablename'