Forum Discussion
EdSpa290
May 03, 2024Copper Contributor
Dynamic sql within stored procedure security context
Hello, We have stored procedure in database dbA, that runs (among other things) dynamic sql. It accesses several dbs, not just the one where stored procedure is (dbA). Db user domainname\username...
olafhelper
May 06, 2024Bronze Contributor
Does anybody have any idea what could be the issue?
Beeing a SQL Server principal/database user isn't enough, the security setting on the linked server must be the right one, see
Create linked servers - SQL Server | Microsoft Learn => Permissions.
- EdSpa290May 06, 2024Copper Contributor
How is this related to linked servers?
We're talking about several databases on the same sql server database instance.