I have a stored procedure that connects to 2 databases. This stored procedure will be used in one of the SSRS reports (SSRS has permission for both databases).
But I only have access to the database where the stored procedure reside.
When I try to alter the stored procedure, I get an error that I don't have permission for the 2nd database.
Is there any way to alter the stored procedure without validating the script inside it?
P.S. dynamic SQL is not acceptable where I work
ALTER PROCEDURE DB1.[DB1].[SP1]
AS
BEGIN
SELECT *
FROM Server2.DB2.dbo.Table2 AS T2
INNER JOIN DB1.dbo.Table1 AS T1 ON T1.ID = T2.ID
END
Error
Msg 18456, Level 14, State 1, Line 8
Login failed for user 'CompanyName\MyUserID'