• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 60
  • Last Modified:

Want to run T-SQL Job with as specific but I can't select the user

Heyas,

As the above title: Want to run T-SQL Job with as specific but I can't select the user.

Attached is a screenshot of what I mean.

I have created SQL user SQL_RG_MP_User and given the sysadmin permission but they don't appear on the list.

Any assistance is appreciated.

Thank you.
Capture.PNG
0
Zack
Asked:
Zack
  • 3
  • 3
1 Solution
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
It's because you didn't give the Login explicit access to the database. You can use dbo instead.
0
 
ZackGeneral IT Goto GuyAuthor Commented:
Hi Vitor,

When I try to give the user explicit access EXEC sp_grantdbaccess 'SQL_RG_MP_User';  

I get the following error:

'SQL_RG_MP_User' is not a valid login or you do not have permission.

How do I resolve this?

Thank you.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Like I said, you need the Login name and not the User name.
Check in the Security section for the Logins. Which one is mapped to the user database 'SQL_RG_MP_User'?
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
ZackGeneral IT Goto GuyAuthor Commented:
Hi Vitor,

Please see the attached pics. As far as I can tell SQL_RG_MP_User is the login name.

Unless I am misunderstanding something.

Than you.
Login-Name-Highlighted.PNG
Login-Name-2.PNG
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
The terminology and the picture you used in your main question really refers to database user.
Now these last pictures shows the Login but only with access to master and msdb databases. Which database is set for the job step?

Btw, why are you mapping credentials for a Resource Governor?
0
 
ZackGeneral IT Goto GuyAuthor Commented:
Thank for the assistance again vitor. The resourcegoverner proxy was just something I was playing around with previously.
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.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now