sa vs sysadmin

are both these the same or 2 different things in SQL Server?

Thanks
LVL 6
anushahannaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
chapmandewConnect With a Mentor Commented:
In this case, they are the same thing.
0
 
chapmandewCommented:
same thing.
0
 
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
sa is a login, meaning that it can establish a connection to the server AND that login has sysadmin level of priviledge.  sysadmin is a server level priviledge that allows any login which has it do pretty much anything no the server.  You may create a login with sysadmin priviledge that is different from sa.  sa is the just the default sysadmin of the server.
1
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
anushahannaAuthor Commented:
OK. so sa does not have anything to do with 'service account', right?
0
 
chapmandewCommented:
functionally, they do the same thing.  Racimo is correct in terms of login vs group

No, neither have anything to do with service accounts.
0
 
anushahannaAuthor Commented:
OK- the reason I ask is this:

I use the following SP to change the owner of the job to sa - this is the default sysadmin login that Racimo mentioned, right?
EXEC MSDB.dbo.sp_update_job @job_name = 'JobName', @owner_login_name = 'sa'

but in auditing i see that the account that ran the job was 'NT AUTHORITY\NETWORK SERVICE'. this is actually the service account on which SQL Server was started and is running on.

that is why i asked about the connection between sa (sysadmin) and sa (service/start account)..

can you see why it may shift like the above?
0
 
chapmandewCommented:
I am assuming that the network service account is a member of the sysadmin group, right?
0
 
anushahannaAuthor Commented:
sysjobs also shows the job having sa as the owner of the job.
0
 
anushahannaAuthor Commented:
these are the sysadmins in the server

sa
BUILTIN\Administrators
NT AUTHORITY\SYSTEM
2 Local Users
1 Domain User
0
 
anushahannaAuthor Commented:
>>I am assuming that the network service account is a member of the sysadmin group

you want to check who is listed under BUILTIN\Administrators?
0
 
chapmandewCommented:
So, NT AUTHORITY\SYSTEM is a sysadmin.  What user runs the SQLAgent service?

Can find this by running services.msc
0
 
anushahannaAuthor Commented:
NT AUTHORITY\NetworkService
runs both SQL and Agent Service.
0
 
chapmandewCommented:
I suspected.  That is why you're seeing that account as running the job.  
0
 
anushahannaAuthor Commented:
so service account of Agent will override the owner of a job at any time?
0
 
anushahannaAuthor Commented:
>>In this case, they are the same thing.

in every case, right?

->even if we gave a diff user here:
EXEC MSDB.dbo.sp_update_job @job_name = 'JobName', @owner_login_name = 'Tim'

it still would override and default to the service account of the agent?
0
 
chapmandewCommented:
Good question.  My guess is that the service account would still show...but there is only one way to find out. :)
0
 
anushahannaAuthor Commented:
OK. I tried-I added a test login called Tim, added the same as user in the DB with read/write/exec (what is needed within the job), and the job has finished executing as Tim.
how do you understand that, in relation to our discussion?
0
 
Racim BOUDJAKDJIConnect With a Mentor Database Architect - Dba - Data ScientistCommented:
<<OK. so sa does not have anything to do with 'service account', right?>>
As the name says, a service account is an account related to the OS rather than a sa which is exclusively related to SQL.
0
 
anushahannaAuthor Commented:
>>As the name says, a service account is an account related to the OS rather than a sa which is exclusively related to SQL.

thanks for the clarification, Racimo.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.