Hi @Shivendoo Kumar ,
Please refer below and check whether it is a little helpful. Thanks.
Declare @VName varchar(256)
Declare Findlinked cursor
LOCAL STATIC FORWARD_ONLY READ_ONLY
FOR
Select name
From sys.servers
Where is_linked = 1
Open Findlinked;
Fetch next from Findlinked into @VName;
while @@FETCH_STATUS = 0
Begin
SELECT OBJECT_NAME(object_id)
FROM sys.sql_modules
WHERE Definition LIKE '%'+@VName +'%'
AND
( OBJECTPROPERTY(object_id, 'IsProcedure') = 1
OR OBJECTPROPERTY(object_id, 'IsTableFunction') = 1
OR OBJECTPROPERTY(object_id, 'IsScalarFunction') = 1
OR OBJECTPROPERTY(object_id, 'IsView') = 1 )
Fetch next from Findlinked into @VName;
End
Close Findlinked
Deallocate Findlinked
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.