Clause SQL EXECUTE AS

I have a SQL account 'ABC' with sysadmin credentials and access to all databases on the server, let's say database A and database B. In contrast, my program employs individuals that have access to only one database A.

I wrote a stored procedure to insert records into the tables of database B. So I'm using the EXECUTE AS clause to execute a stored procedure with user ABC, but after some testing, I discovered from this source that if my application users don't have the exact same server roles as user ABC, it doesn't work. When I make another user sysadmin, there are no errors and everything works well. What is the point of this EXECUTE AS command if both users must have the same roles?

You need to be a member of Virtual Academy of Pakistan to add comments!

Join Virtual Academy of Pakistan

Votes: 0
Email me when people reply –

Activity

Syed Nayab Bukhari updated their profile
Jan 30
Syed Nayab Bukhari, Rafi and Osaf ali joined Virtual Academy of Pakistan
IT/CS/SE IT/CS/SE Business Study
Jan 29
Bareera Adnan updated their profile
Dec 10, 2023
Aqsa and Mahmood Iqbal joined Virtual Academy of Pakistan
Business Study
Dec 3, 2023
Farhad Ali, jamila and RAI RIAZ AHMAD joined Virtual Academy of Pakistan
IT/CS/SE Business Study
Nov 11, 2023
Arman Ali posted a status
:(
Nov 3, 2023
Jekky Sharma replied to Ashley's discussion Data science coding interviews
"It's great that you're preparing for coding interviews, even with a non-technical background. Data science interviews typically focus more on your ability to work with data, analyze it, and build machine learning models. However, it's still possible…"
Oct 23, 2023
zain is now a member of Virtual Academy of Pakistan
Oct 8, 2023
Jekky Sharma posted a discussion
I'm working on a SQL query for a database containing records of customer transactions. Each transaction has a transaction_id, customer_id, transaction_date, and amount. I need to find the latest transaction for each customer.Here's a simplified…
Oct 5, 2023
Jekky Sharma posted a discussion
I'm working on a JavaScript project that involves retrieving and displaying the current date and time, considering different time zones. However, I've encountered a complex error in my code that's leading to unexpected output, especially when…
Sep 21, 2023
ZAK updated their profile photo
Sep 9, 2023
Bareera Adnan is now a member of Virtual Academy of Pakistan
Sep 7, 2023
Jekky Sharma posted a discussion in C++ Programming Fundamentals
 I'm working on a Python project where I have multiple functions, and I want to log each function call along with its arguments and return value for debugging purposes. I've heard that decorators can help achieve this. Could someone guide me on how…
Sep 6, 2023
saad jamal is now a member of Virtual Academy of Pakistan
Jul 19, 2023
The Joker posted a status
Assignment wali gal koi nai ethay fer :p
Jul 9, 2023
Tabassam Ali updated their profile
Jul 3, 2023
More…