I get a syntax error with this TSQL:
if exists ( exec('select * from mytable') at LinkedOracleServer ) begin
print 'rows exist'
end
I can't use INSERT EXEC into a temp table because the calling proc also uses INSERT EXEC and I get the error "An INSERT EXEC statement cannot be nested."
Is there another way to test for existing rows on a linked server?