A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
Are you logged as this user in both SQL Server instances? Your function checks rights of the currently logged user.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'm having the following problem
cenario:
1 -StoreProcedure A in database A calls Function B from Database B
2- Function B:
Return IS_MEMBER('ROLE')
3- the current user is a member of 'ROLE' on database B and not a member on Database A
In SQLServer 2019 when i call StoreProcedure A from Database A it returns 'False', but if i call Function B from database B it returns true.
With SQLServer 2016 both return true;
Was there a change 2019? Is it a server configuration? Documentation doesn't mention any changes.
Any help or insights would be much appreciated.
Best Regards
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted commentComments have been turned off. Learn more
Are you logged as this user in both SQL Server instances? Your function checks rights of the currently logged user.
Ok, ill try to show the snipets:
as u can see the user 'Anacarvalho' exists in both Test_DBA and Test_DBB however it only has the ROLE 'RoleA' in Test_DBB
consider the folowing function in Test_DBB
when i execute in 2019:
when executed in 2016
any thouts?
We would need to see a repro that demonstrates the issue. The repro would have to create the databases, the user and the role.
Most likely when you test it, you will find that the result is the same on SQL 2016 and SQL 2019.
My guess is that the difference you are seeing is due to that permissions are set up differently.
But as I said, provide a repro, if you want us to take a closer look.