<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Fix SQL Server Error 15174: Login owns one or more database(s). Change the owner of database(s) before dropping the login.	</title>
	<atom:link href="https://techyaz.com/sql-server/troubleshooting/fix-the-error-15174/feed/" rel="self" type="application/rss+xml" />
	<link>https://techyaz.com/sql-server/troubleshooting/fix-the-error-15174/</link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Wed, 01 Dec 2021 09:18:10 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>
	<item>
		<title>
		By: Komal		</title>
		<link>https://techyaz.com/sql-server/troubleshooting/fix-the-error-15174/#comment-400</link>

		<dc:creator><![CDATA[Komal]]></dc:creator>
		<pubDate>Wed, 01 Dec 2021 09:18:10 +0000</pubDate>
		<guid isPermaLink="false">http://techyaz.com/?p=373#comment-400</guid>

					<description><![CDATA[Was help full for me. Thankyou for such a nice explaination.]]></description>
			<content:encoded><![CDATA[<p>Was help full for me. Thankyou for such a nice explaination.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: S.E.		</title>
		<link>https://techyaz.com/sql-server/troubleshooting/fix-the-error-15174/#comment-307</link>

		<dc:creator><![CDATA[S.E.]]></dc:creator>
		<pubDate>Wed, 10 Feb 2021 15:28:22 +0000</pubDate>
		<guid isPermaLink="false">http://techyaz.com/?p=373#comment-307</guid>

					<description><![CDATA[One comment to the part where you determine database ownership with sp_helpdb:
in an AG setup where you don&#039;t have a readable secondary replica, it can happen that the db owner on a secondary replica is different from owner on the primary replica. In this setup, on a secondary node, sp_helpdb won&#039;t show you the databases that are part of the AG. However, you might use this query to get the db owner information:

SELECT 
	@@SERVERNAME AS ServerName,
	[name] AS dbname, 
	SUSER_SNAME(owner_sid) AS owner
FROM 
	sys.databases 
WHERE 
	SUSER_SNAME(owner_sid) != &#039;sa&#039;;

You might omit the WHERE clause if you want to get all the databases back.

On a secondary replica you cannot change the database owner because the database cannot be modified. To do this, you need to wait until the secondary replica becomes the primary (e.g. a failover happens).]]></description>
			<content:encoded><![CDATA[<p>One comment to the part where you determine database ownership with sp_helpdb:<br />
in an AG setup where you don&#8217;t have a readable secondary replica, it can happen that the db owner on a secondary replica is different from owner on the primary replica. In this setup, on a secondary node, sp_helpdb won&#8217;t show you the databases that are part of the AG. However, you might use this query to get the db owner information:</p>
<p>SELECT<br />
	@@SERVERNAME AS ServerName,<br />
	[name] AS dbname,<br />
	SUSER_SNAME(owner_sid) AS owner<br />
FROM<br />
	sys.databases<br />
WHERE<br />
	SUSER_SNAME(owner_sid) != &#8216;sa&#8217;;</p>
<p>You might omit the WHERE clause if you want to get all the databases back.</p>
<p>On a secondary replica you cannot change the database owner because the database cannot be modified. To do this, you need to wait until the secondary replica becomes the primary (e.g. a failover happens).</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
