﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance. / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 18 May 2013 11:13:14 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Okay, again, so much clarity in hindsight.I also see another source of my confusion.  Apparently, a stored proc is owned by whoever owns the schema it is in, by default, unless its specifically changed via ALTER AUTHORIZATION.  So while schema != owner, the schema owner IS the procedure owner, unless it's been specifically changed.  In my case, I'm seeing sa run these things because the proc is in the dbo schema, and the dbo schema is owned by dbo.  I guess dbo = sa when it translates to login.More info on [url=http://www.sqlservercentral.com/blogs/brian_kelley/2009/03/04/owning-an-object-in-sql-server-2005-2008/]default ownership[/url]:</description><pubDate>Tue, 18 Dec 2012 09:13:47 GMT</pubDate><dc:creator>llevity</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Schema != ownerThat proc is old (pre SQL 2005) and hence changing schema and owner, before SQL 2005 they were the same thing. Use ALTER AUTHORIZATION to change owner and ALTER SCHEMA to move a table to a new schema.Books Online:[quote][b]sp_changeobjectowner[/b]Changes the owner of an object in the current database.Important:  This stored procedure only works with the objects available in Microsoft SQL Server 2000. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER SCHEMA or ALTER AUTHORIZATION instead. [b]sp_changeobjectowner changes both the schema and the owner.[/b] To preserve compatibility with earlier versions of SQL Server, this stored procedure will only change object owners when both the current owner and the new owner own schemas that have the same name as their database user names. [/quote]</description><pubDate>Tue, 18 Dec 2012 08:55:23 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Another thing to file in my "bad assumptions" filing cabinet.Another question, then.  When I change the object owner of the proc via sp_changeobjectowner, it changes the schema from dbo to the new owner I specify.  Is this a case where schema and owner are the same thing?  And this EXECUTE AS OWNER proc is running as sa because it's in the dbo schema?</description><pubDate>Tue, 18 Dec 2012 08:42:06 GMT</pubDate><dc:creator>llevity</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>[quote][b]llevity (12/18/2012)[/b][hr]The procs were set to EXECUTE AS OWNER, and the database was owned by sa in our QA environment.  Thanks a ton![/quote]Execute as owner does not use the database owner, it uses the procedure owner. Means a sysadmin created the procedures, that's all.</description><pubDate>Tue, 18 Dec 2012 08:25:14 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Aaaaah, thanks guys.  I feel so dumb now.  Why are these things always so obvious in hindsight?The procs were set to EXECUTE AS OWNER, and the database was owned by sa in our QA environment.  Thanks a ton!</description><pubDate>Tue, 18 Dec 2012 08:00:25 GMT</pubDate><dc:creator>llevity</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Impersonation? Got procs with EXECUTE AS 'sa' in them?</description><pubDate>Tue, 18 Dec 2012 07:52:07 GMT</pubDate><dc:creator>GilaMonster</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>Do the procs have the EXECUTE AS clause to let them run under higher privileged accounts?</description><pubDate>Tue, 18 Dec 2012 07:51:52 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>They're not system processes, though.  I see a NTUserName associated with the process and they're executing user stored procs called from a web app.</description><pubDate>Tue, 18 Dec 2012 07:45:57 GMT</pubDate><dc:creator>llevity</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>System processes are no longer limited to SPID &amp;lt; 50 they can go over 50 depending on the task they perform.</description><pubDate>Tue, 18 Dec 2012 07:04:34 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>RE: Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>'sa' account is the default sql admin user and all system processes 'below spid 50' uses saRegards</description><pubDate>Tue, 18 Dec 2012 07:03:13 GMT</pubDate><dc:creator>Nchax Phoku</dc:creator></item><item><title>Profiler shows LoginName as 'sa', but 'sa' is disabled on the instance.</title><link>http://www.sqlservercentral.com/Forums/Topic1396819-391-1.aspx</link><description>As the subject says, I have a profiler running and see some things executing as 'sa' in the LoginName field, but 'sa' on the server is disabled.  I even changed its password.These aren't system level processes, as the NTUserName is an actual user, who is using the application that connects to the database on our dev environment.  Any ideas on what's going on?</description><pubDate>Fri, 14 Dec 2012 14:27:42 GMT</pubDate><dc:creator>llevity</dc:creator></item></channel></rss>