Find Linked Server Usage in SQL

Very useful script if wanting to know where Linked Servers are being called:

SET NOCOUNT ON;
DECLARE @VName VARCHAR(256)
DECLARE Findlinked CURSOR
LOCAL STATIC FORWARD_ONLY READ_ONLY
     FOR
SELECT name AS name
    FROM sys.servers
    WHERE is_linked = 1
 
OPEN Findlinked;
FETCH NEXT FROM Findlinked INTO @VName;
 
WHILE @@FETCH_STATUS = 0
BEGIN
    SELECT @VName, OBJECT_NAME(OBJECT_ID) 
        FROM sys.sql_modules 
        WHERE Definition LIKE '%'+@VName +'%' 
        AND (OBJECTPROPERTY(OBJECT_ID, 'IsProcedure') = 1 
        OR OBJECTPROPERTY(OBJECT_ID, 'IsView') = 1);
 
    FETCH NEXT FROM Findlinked INTO @VName;
END
CLOSE Findlinked
 
OPEN Findlinked;
FETCH NEXT FROM Findlinked INTO @VName;
 
WHILE @@FETCH_STATUS = 0
BEGIN
    SELECT j.name AS JobName,js.command 
        FROM msdb.dbo.sysjobsteps js
            INNER JOIN msdb.dbo.sysjobs j
                ON j.job_id = js.job_id
        WHERE js.command LIKE '%'+@VName +'%'
    FETCH NEXT FROM Findlinked INTO @VName;
END
 
CLOSE Findlinked
DEALLOCATE Findlinked

OPENQUERY using Linked Server: SQL to Oracle

Handy T-SQL for manipulating data at destination oracle db from SQL Server.

Once the Linked Server has been created, the following DML can be used:

--SELECT
select * from openquery([ORADB.MYSCHEMA], 'select * from nvdimage')
--INSERT
insert openquery([ORADB.MYSCHEMA], 'SELECT IMA_IMAGEID,IMA_IMAGE FROM nvdimage')
SELECT IMA_IMAGEID, IMA_IMAGE FROM nvdimage
--DELETE
delete openquery([ORADB.MYSCHEMA], 'select * from nvdimage')
--UPDATE
update openquery([ORADB.MYSCHEMA], 
'select column_a, column_b from myschema.table_name where pk = pk_value')
SET column_a = 'value1', column_b = 'my_value2'