{"id":213,"date":"2011-03-01T10:45:49","date_gmt":"2011-03-01T02:45:49","guid":{"rendered":"http:\/\/www.royalwzy.com\/?p=213"},"modified":"2013-12-30T13:59:43","modified_gmt":"2013-12-30T05:59:43","slug":"%e5%a6%82%e4%bd%95%e6%9b%b4%e6%94%b9%e5%af%b9%e8%b1%a1%e6%89%80%e5%b1%9e%e7%9a%84%e6%9e%b6%e6%9e%84","status":"publish","type":"post","link":"http:\/\/www.royalwzy.com\/?p=213","title":{"rendered":"\u5982\u4f55\u66f4\u6539\u5bf9\u8c61\u6240\u5c5e\u7684\u67b6\u6784"},"content":{"rendered":"<p style=\"color: #333333; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"zh-CN\">\u5982\u4f55<\/span><span lang=\"zh-CN\">\u5728\u67b6\u6784\u4e4b\u95f4\u4f20\u8f93\u5b89\u5168\u5bf9\u8c61<\/span><span lang=\"en-US\">?<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u8bed\u6cd5\uff1aALTER SCHEMA\u00a0<span style=\"font-style: italic;\">schema_name<\/span>\u00a0TRANSFER\u00a0<span style=\"font-style: italic;\">securable_name<\/span><\/span><\/span><\/p>\n<p style=\"font-style: normal; font-variant: normal; margin: 0in; font-family: 'Courier New'; color: black; font-size: 9pt;\"><span style=\"font-weight: bold;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u53c2\u6570<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">1.<\/span><span lang=\"zh-CN\">schema_name<\/span><span lang=\"en-US\">:<\/span><span lang=\"zh-CN\">\u5f53\u524d\u6570\u636e\u5e93\u4e2d\u7684\u67b6\u6784\u540d\u79f0\uff0c\u5b89\u5168\u5bf9\u8c61\u5c06\u79fb\u5165\u5176\u4e2d\u3002\u5176\u6570\u636e\u7c7b\u578b\u4e0d\u80fd\u4e3a\u00a0<\/span><span lang=\"zh-CN\" style=\"font-weight: bold;\">SYS<\/span><span lang=\"zh-CN\">\u00a0<\/span><span lang=\"zh-CN\">\u6216<\/span><span lang=\"zh-CN\" style=\"font-weight: bold;\">INFORMATION_SCHEMA<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span lang=\"en-US\">2.<\/span><span lang=\"zh-CN\">securable_name<\/span><span lang=\"en-US\">:<\/span><span lang=\"zh-CN\">\u8981\u79fb\u5165\u67b6\u6784\u4e2d\u7684\u67b6\u6784\u5305\u542b\u5b89\u5168\u5bf9\u8c61\u7684\u4e00\u90e8\u5206\u6216\u4e24\u90e8\u5206\u540d\u79f0<\/span><\/span><\/span><\/p>\n<p style=\"font-style: normal; font-variant: normal; margin: 0in; font-family: 'Courier New'; color: black; font-size: 9pt;\"><span style=\"font-weight: bold;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u5907\u6ce8<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u7528\u6237\u4e0e\u67b6\u6784\u5b8c\u5168\u5206\u79bb\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u7528\u6237\u67b6\u6784\u5206\u79bb\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">ALTER SCHEMA \u4ec5\u53ef\u7528\u4e8e\u5728\u540c\u4e00\u6570\u636e\u5e93\u4e2d\u7684\u67b6\u6784\u4e4b\u95f4\u79fb\u52a8\u5b89\u5168\u5bf9\u8c61\u3002\u82e5\u8981\u66f4\u6539\u6216\u5220\u9664\u67b6\u6784\u4e2d\u7684\u5b89\u5168\u5bf9\u8c61\uff0c\u8bf7\u4f7f\u7528\u7279\u5b9a\u4e8e\u8be5\u5b89\u5168\u5bf9\u8c61\u7684 ALTER \u6216 DROP \u8bed\u53e5\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u5982\u679c\u5bf9\u00a0<span style=\"font-style: italic;\">securable_name<\/span>\u00a0\u4f7f\u7528\u4e86\u7531\u4e00\u90e8\u5206\u7ec4\u6210\u7684\u540d\u79f0\uff0c\u5219\u5c06\u4f7f\u7528\u5f53\u524d\u751f\u6548\u7684\u540d\u79f0\u89e3\u6790\u89c4\u5219\u67e5\u627e\u8be5\u5b89\u5168\u5bf9\u8c61\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u5c06\u5b89\u5168\u5bf9\u8c61\u79fb\u5165\u65b0\u67b6\u6784\u65f6\uff0c\u5c06\u5220\u9664\u4e0e\u8be5\u5b89\u5168\u5bf9\u8c61\u5173\u8054\u7684\u5168\u90e8\u6743\u9650\u3002\u5982\u679c\u5df2\u663e\u5f0f\u8bbe\u7f6e\u5b89\u5168\u5bf9\u8c61\u7684\u6240\u6709\u8005\uff0c\u5219\u8be5\u6240\u6709\u8005\u4fdd\u6301\u4e0d\u53d8\u3002\u5982\u679c\u5b89\u5168\u5bf9\u8c61\u7684\u6240\u6709\u8005\u5df2\u8bbe\u7f6e\u4e3a SCHEMA OWNER\uff0c\u5219\u8be5\u6240\u6709\u8005\u5c06\u4fdd\u6301\u4e3a SCHEMA OWNER\uff1b\u4f46\u79fb\u52a8\u4e4b\u540e\uff0cSCHEMA OWNER \u5c06\u89e3\u6790\u4e3a\u65b0\u67b6\u6784\u7684\u6240\u6709\u8005\u3002\u65b0\u6240\u6709\u8005\u7684\u00a0<span style=\"font-weight: bold;\">principal_id<\/span>\u00a0\u5c06\u4e3a NULL\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\"><span style=\"font-weight: bold;\">\u6ce8\u610f\uff1a<\/span>\u4ece SQL Server 2005 \u5f00\u59cb\uff0c\u67b6\u6784\u7684\u884c\u4e3a\u53d1\u751f\u4e86\u66f4\u6539\u3002\u56e0\u6b64\uff0c\u5047\u8bbe\u67b6\u6784\u4e0e\u6570\u636e\u5e93\u7528\u6237\u7b49\u4ef7\u7684\u4ee3\u7801\u4e0d\u518d\u8fd4\u56de\u6b63\u786e\u7684\u7ed3\u679c\u3002\u5305\u542b\u00a0<span style=\"font-weight: bold;\">sysobjects<\/span>\u00a0\u7684\u65e7\u76ee\u5f55\u89c6\u56fe\u4e0d\u5e94\u5728\u66fe\u7ecf\u4f7f\u7528\u4efb\u4f55\u4e0b\u5217 DDL \u8bed\u53e5\u7684\u6570\u636e\u5e93\u4e2d\u4f7f\u7528\uff1aCREATE SCHEMA\u3001ALTER SCHEMA\u3001DROP SCHEMA\u3001CREATE USER\u3001ALTER USER\u3001DROP USER\u3001CREATE ROLE\u3001ALTER ROLE\u3001DROP ROLE\u3001CREATE APPROLE\u3001ALTER APPROLE\u3001DROP APPROLE\u3001ALTER AUTHORIZATION\u3002\u5728\u8fd9\u7c7b\u6570\u636e\u5e93\u4e2d\uff0c\u5fc5\u987b\u6539\u7528\u65b0\u76ee\u5f55\u89c6\u56fe\u3002\u65b0\u7684\u76ee\u5f55\u89c6\u56fe\u5c06\u91c7\u7528\u5728 SQL Server 2005 \u4e2d\u5f15\u5165\u7684\u4f7f\u4e3b\u4f53\u548c\u67b6\u6784\u5206\u79bb\u7684\u65b9\u6cd5<\/span><\/span><\/p>\n<p style=\"font-style: normal; font-variant: normal; margin: 0in; font-family: 'Courier New'; color: black; font-size: 9pt;\"><span style=\"font-weight: bold;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u6743\u9650<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u82e5\u8981\u4ece\u53e6\u4e00\u4e2a\u67b6\u6784\u4e2d\u4f20\u8f93\u5b89\u5168\u5bf9\u8c61\uff0c\u5f53\u524d\u7528\u6237\u5fc5\u987b\u62e5\u6709\u5bf9\u8be5\u5b89\u5168\u5bf9\u8c61\uff08\u975e\u67b6\u6784\uff09\u7684 CONTROL \u6743\u9650\uff0c\u5e76\u62e5\u6709\u5bf9\u76ee\u6807\u67b6\u6784\u7684 ALTER \u6743\u9650\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u5982\u679c\u5df2\u4e3a\u5b89\u5168\u5bf9\u8c61\u6307\u5b9a EXECUTE AS OWNER\uff0c\u4e14\u6240\u6709\u8005\u5df2\u8bbe\u7f6e\u4e3a SCHEMA OWNER\uff0c\u5219\u7528\u6237\u8fd8\u5fc5\u987b\u62e5\u6709\u5bf9\u76ee\u6807\u67b6\u6784\u6240\u6709\u8005\u7684 IMPERSONATION \u6743\u9650\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u5728\u79fb\u52a8\u5b89\u5168\u5bf9\u8c61\u540e\uff0c\u5c06\u5220\u9664\u4e0e\u6240\u4f20\u8f93\u7684\u5b89\u5168\u5bf9\u8c61\u76f8\u5173\u8054\u7684\u6240\u6709\u6743\u9650\u3002<\/span><\/span><\/p>\n<p style=\"font-style: normal; font-variant: normal; margin: 0in; font-family: 'Courier New'; color: black; font-size: 9pt;\"><span style=\"font-weight: bold;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u793a\u4f8b<\/span><\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">\u4ee5\u4e0b\u793a\u4f8b\u901a\u8fc7\u5c06\u8868 Address \u4ece\u67b6\u6784 Person \u4f20\u8f93\u5230 HumanResources \u67b6\u6784\u6765\u4fee\u6539\u8be5\u67b6\u6784\u3002<\/span><\/span><\/p>\n<p style=\"font-family: Arial; font-style: normal; font-variant: normal; margin: 0in; color: black; font-size: 9pt;\"><span style=\"font-family: 'courier new', courier;\"><span style=\"font-size: small;\">USE AdventureWorks;<br \/>\nGO<br \/>\nALTER SCHEMA HumanResources TRANSFER Person.Address;<br \/>\nGO<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728\u67b6\u6784\u4e4b\u95f4\u4f20\u8f93\u5b89\u5168\u5bf9\u8c61? \u8bed\u6cd5\uff1aALTER SCHEMA\u00a0schema_name\u00a0TRANSFER\u00a0sec [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[16],"class_list":["post-213","post","type-post","status-publish","format-standard","hentry","category-sqlserver","tag-sql_server_2008_r2"],"_links":{"self":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=213"}],"version-history":[{"count":0,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=\/wp\/v2\/posts\/213\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.royalwzy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}