{"id":2399,"date":"2012-12-31T11:24:10","date_gmt":"2012-12-31T11:24:10","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=2399"},"modified":"2012-12-31T11:24:10","modified_gmt":"2012-12-31T11:24:10","slug":"%e7%ba%a7%e8%81%94%e5%88%a0%e9%99%a4","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2012\/12\/31\/%e7%ba%a7%e8%81%94%e5%88%a0%e9%99%a4\/","title":{"rendered":"\u7ea7\u8054\u5220\u9664"},"content":{"rendered":"<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t<span style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); font-size: x-large; \"><strong style=\"margin: 0px; padding: 0px; \">\u901a\u8fc7\u89e6\u53d1\u5668\u6765\u7ea7\u8054\u5220\u9664\uff1a<\/strong><\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u5177\u4f53\u7684\u89e6\u53d1\u5668\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"csharpcode\" style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-size: small; font-family: consolas, 'Courier New', courier, monospace; background-color: rgb(255, 255, 255); \">\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">Create<\/span> <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">TRIGGER<\/span> [dbo].[DeleteRelatedProducts] <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">ON<\/span>  [dbo].[ProductCategory]\r\n <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">AFTER<\/span> <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">DELETE<\/span>\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">AS<\/span> \r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">BEGIN<\/span>\r\n    <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">SET<\/span> NOCOUNT <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">ON<\/span>;\r\n    <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">delete<\/span> <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> [dbo].[product] <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">where<\/span> categoryId <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">in<\/span> \r\n    (\r\n        <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">select<\/span> id <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> deleted\r\n    )\r\nEND<\/pre>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8f83\u7b80\u5355\uff0c\u800c\u4e14\u8bed\u6cd5\u4e5f\u5f88\u660e\u4e86\uff1a<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u5177\u4f53\u8d44\u6599\u53ef\u4ee5\u53c2\u7167\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms191300(SQL.105).aspx\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \" title=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms191300(SQL.105).aspx\"><span style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">http:\/\/msdn.microsoft.com\/en-us\/library\/ms191300(SQL.105).aspx<\/span><\/a><\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t&nbsp;<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f\u53ef\u80fd\u5e76\u4e0d\u662f\u5f88\u591a\u4eba\u77e5\u9053\uff1a<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t<span style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); font-size: x-large; \"><strong style=\"margin: 0px; padding: 0px; \">\u5916\u952e\u7684\u7ea7\u8054\u5220\u9664\u548c\u66f4\u65b0\uff1a<\/strong><\/span><\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u5728sql server \u4e2d\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u5916\u952e\u7684\u7ea7\u8054\u5220\u9664\u548c\u66f4\u65b0\u6765\u5b9e\u73b0\u8fd9\u4e2a\u529f\u80fd\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u8fd9\u91cc\u662f<strong style=\"margin: 0px; padding: 0px; \">\u5916\u952e<\/strong>\u7684\u5b9a\u4e49\uff1a\u6765\u81ea<a href=\"http:\/\/baike.baidu.com\/view\/68073.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \" title=\"http:\/\/baike.baidu.com\/view\/68073.htm\">http:\/\/baike.baidu.com\/view\/68073.htm<\/a><\/p>\n<h5 style=\"margin: 0px; padding: 0px; font-size: 10pt; font-family: verdana, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); \">\n\t<a name=\"1_1\" style=\"margin: 0px; padding: 0px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><\/a><a name=\"sub68073_1_1\" style=\"margin: 0px; padding: 0px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><\/a>\u7b80\u4ecb<\/h5>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u5916\u952e\uff08Foreign Key\uff09<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u5982\u679c<a href=\"http:\/\/baike.baidu.com\/view\/68474.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u516c\u5171\u5173\u952e\u5b57<\/a>\u5728\u4e00\u4e2a\u5173\u7cfb\u4e2d\u662f<a href=\"http:\/\/baike.baidu.com\/view\/68467.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u4e3b\u5173\u952e\u5b57<\/a>\uff0c\u90a3\u4e48\u8fd9\u4e2a\u516c\u5171\u5173\u952e\u5b57\u88ab\u79f0\u4e3a\u53e6\u4e00\u4e2a\u5173\u7cfb\u7684\u5916\u952e\u3002\u7531\u6b64\u53ef\u89c1\uff0c\u5916\u952e\u8868\u793a\u4e86\u4e24\u4e2a\u5173\u7cfb\u4e4b\u95f4\u7684\u8054\u7cfb\u3002\u4ee5\u53e6\u4e00\u4e2a\u5173\u7cfb\u7684\u5916\u952e\u4f5c<a href=\"http:\/\/baike.baidu.com\/view\/68467.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u4e3b\u5173\u952e\u5b57<\/a>\u7684\u8868\u88ab\u79f0\u4e3a\u4e3b\u8868\uff0c\u5177\u6709\u6b64\u5916\u952e\u7684\u8868\u88ab\u79f0\u4e3a\u4e3b\u8868\u7684\u4ece\u8868\u3002\u5916\u952e\u53c8\u79f0\u4f5c<a href=\"http:\/\/baike.baidu.com\/view\/68477.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u5916\u5173\u952e\u5b57<\/a>\u3002\u6362\u800c\u8a00\u4e4b\uff0c\u5982\u679c\u5173\u7cfb\u6a21\u5f0fR\u4e2d\u7684\u67d0\u5c5e\u6027\u96c6\u4e0d\u662fR\u7684<a href=\"http:\/\/baike.baidu.com\/view\/68068.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u4e3b\u952e<\/a>\uff0c\u800c\u662f\u53e6\u4e00\u4e2a\u5173\u7cfbR1\u7684\u4e3b\u952e\u5219\u8be5\u5c5e\u6027\u96c6\u662f\u5173\u7cfb\u6a21\u5f0fR\u7684\u5916\u952e\uff0c\u901a\u5e38\u5728<a href=\"http:\/\/baike.baidu.com\/view\/8268.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u6570\u636e\u5e93\u8bbe\u8ba1<\/a>\u4e2d\u7f29\u5199\u4e3aFK\u3002<\/p>\n<h5 style=\"margin: 0px; padding: 0px; font-size: 10pt; font-family: verdana, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255); \">\n\t<a name=\"1_2\" style=\"margin: 0px; padding: 0px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><\/a><a name=\"sub68073_1_2\" style=\"margin: 0px; padding: 0px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><\/a>\u5916\u952e\u7684\u4f5c\u7528<\/h5>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u4fdd\u6301<a href=\"http:\/\/baike.baidu.com\/view\/4138648.htm\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \">\u6570\u636e\u4e00\u81f4\u6027<\/a>\uff0c\u5b8c\u6574\u6027\uff0c\u4e3b\u8981\u76ee\u7684\u662f\u63a7\u5236\u5b58\u50a8\u5728\u5916\u952e\u8868\u4e2d\u7684\u6570\u636e\u3002 \u4f7f\u4e24\u5f20\u8868\u5f62\u6210\u5173\u8054\uff0c\u5916\u952e\u53ea\u80fd\u5f15\u7528\u5916\u8868\u4e2d\u7684\u5217\u7684\u503c\u6216\u4f7f\u7528\u7a7a\u503c<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t&nbsp;<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u6211\u4eec\u73b0\u5728\u7684\u8981\u6c42\u662f\u5220\u9664<strong style=\"margin: 0px; padding: 0px; \">ProductCategory<\/strong>\u7684\u65f6\u5019\uff0c\u540c\u65f6\u5220\u9664\u8be5<strong style=\"margin: 0px; padding: 0px; \">ProductCategory<\/strong>\u4e0b\u9762\u7684<strong style=\"margin: 0px; padding: 0px; \">Product<\/strong>\u3002<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u6240\u4ee5\u5e94\u8be5\u5728Product \u8868\u4e2d\u5efa\u7acb\u5916\u952e\u7ea6\u675f\uff0c<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t<a href=\"http:\/\/images.cnitblog.com\/blog\/67224\/201212\/31072212-d3fe8d127fac47b7af4429645a84452f.jpg\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><img loading=\"lazy\" decoding=\"async\" alt=\"41CAF4CCE0594D539B8FE9DFF831BC31\" border=\"0\" height=\"433\" src=\"http:\/\/images.cnitblog.com\/blog\/67224\/201212\/31072213-0d38c689b5c048b4a8715729e3d18a5b.jpg\" style=\"margin: 0px; padding: 0px; border: 0px; display: inline; \" title=\"41CAF4CCE0594D539B8FE9DFF831BC31\" width=\"648\" \/><\/a><\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t&nbsp;<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u770b\u5230\u5220\u9664\u89c4\u5219\u4e86\u5417\uff0c\u6307\u5b9a\u4e3a\u5c42\u53e0\u7684\u8bdd\uff0c\u90a3\u4e48\u5f53\u5220\u9664ProductCategory\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u5220\u9664Product\u4e86\u3002<\/p>\n<pre class=\"csharpcode\" style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-size: small; font-family: consolas, 'Courier New', courier, monospace; background-color: rgb(255, 255, 255); \">\r\n<\/pre>\n<pre class=\"csharpcode\" style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-size: small; font-family: consolas, 'Courier New', courier, monospace; background-color: rgb(255, 255, 255); \">\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">select<\/span> * <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> ProductCategory;\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">select<\/span> * <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> product;\r\n\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">Delete<\/span> <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> ProductCategory;\r\n\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">select<\/span> * <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> ProductCategory;\r\n<span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">select<\/span> * <span class=\"kwrd\" style=\"margin: 0px; padding: 0px; color: rgb(0, 0, 255); \">from<\/span> product;<\/pre>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25px; background-color: rgb(255, 255, 255); \">\n\t<a href=\"http:\/\/images.cnitblog.com\/blog\/67224\/201212\/31072214-9e3eea63a2aa42c29a52d6fafc7772b5.jpg\" style=\"margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); \"><img loading=\"lazy\" decoding=\"async\" alt=\"8DD435ED59A34A0EB60B4D7AC9A81A07\" border=\"0\" height=\"294\" src=\"http:\/\/images.cnitblog.com\/blog\/67224\/201212\/31072214-47ce16fa2df247ee95b3f0f5d33f24b6.jpg\" style=\"margin: 0px; padding: 0px; border: 0px; display: inline; \" title=\"8DD435ED59A34A0EB60B4D7AC9A81A07\" width=\"600\" \/><\/a><\/p>\n<p>\n\u5f15\u81ea\uff1a<a href=\"http:\/\/www.cnblogs.com\/LoveJenny\/archive\/2012\/12\/31\/2840238.html\">\u5173\u4e8e\u6570\u636e\u7684\u7ea7\u8054\u5220\u9664\u548c\u66f4\u65b0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u901a\u8fc7\u89e6\u53d1\u5668\u6765\u7ea7\u8054\u5220\u9664\uff1a \u5177\u4f53\u7684\u89e6\u53d1\u5668\u4ee3\u7801\u5982\u4e0b\uff1a Create TRIGGER [dbo].[DeleteRel [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2399","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=2399"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2399\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=2399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=2399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=2399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}