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

Wazir khan and marry joined Virtual Academy of Pakistan
Business Study Accounting & Finance
Mar 14
Namal and ALI ZAMAN HAIDER are now friends
Accounting & Finance
Mar 14
تاشہ updated their profile photo
Mar 10
تاشہ updated their profile
Mar 10
تاشہ updated their profile photo
Mar 10
rihan, Irfan Iftikhar, Namal and 3 more joined Virtual Academy of Pakistan
IT/CS/SE IT/CS/SE IT/CS/SE IT/CS/SE
Mar 10
Annie is now friends with Zulfiqar Hussain and Akbar
IT/CS/SE Business Study
Mar 10
Carool, Muhammad Mohtisham, basharat and 3 more joined Virtual Academy of Pakistan
Business Study IT/CS/SE Accounting & Finance Accounting & Finance Business Study
Mar 2
+Gїѵїпg Hёаят! updated their profile
Feb 19
+Gїѵїпg Hёаят! updated their profile photo
Feb 19
bharani adithya posted a discussion
Python is well-liked because it strongly emphasizes straightforward syntax and plain English. When a programmer writes code, they must adhere to certain principles known as syntax. Due to its high-level nature, there aren't as many obscure symbols…
Feb 16
bharani adithya posted a discussion
Python is well-liked because it strongly emphasizes straightforward syntax and plain English. When a programmer writes code, they must adhere to certain principles known as syntax. Due to its high-level nature, there aren't as many obscure symbols…
Feb 16
Sherry Vu and Zahid Hussain joined Virtual Academy of Pakistan
IT/CS/SE
Feb 14
Nouman is now a member of Virtual Academy of Pakistan
Feb 13
Mady and Tehreem fatima joined Virtual Academy of Pakistan
Accounting & Finance
Feb 8
A_Ali-Ali and Muhammad Ammar joined Virtual Academy of Pakistan
IT/CS/SE IT/CS/SE
Feb 6
More…