<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "MSSQL改變Table Owner"]]></title>
		<link>https://forum.andowson.com/posts/list/12.page</link>
		<description><![CDATA[Latest messages posted in the topic "MSSQL改變Table Owner"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>MSSQL改變Table Owner</title>
				<description><![CDATA[ 在另一部SQL Server上作資料庫還原時，如果原來的資料庫有某個使用者帳號自建的table時，將無法刪除該帳號。如此一來便無法在新的SQL Server上重新設定該帳號為還原後資料庫的db_owner。 
<br>
<br>
這時我們需要先改變table的擁有人為dbo： 
<br>
[code]exec sp_changeobjectowner 'oldowner.tablename', 'dbo'[/code] 
<br>
<br>
然後再去刪除該帳號，再重新建立該帳號並將資料庫指派給該帳號當作db_owner即可。 
<br>
<br>
參考資料： 
<br>
http://blog.bestlong.idv.tw/2005/03/27/mssql-%E6%94%B9%E8%AE%8A-database-%E4%B8%AD-table-%E7%9A%84-owner/]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/245/376.page</guid>
				<link>https://forum.andowson.com/posts/preList/245/376.page</link>
				<pubDate><![CDATA[Wed, 7 May 2008 22:06:36]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>