Martin James

Martin James

  • 1.9k
  • 96
  • 2.3k

Openquery inside an openquery

Apr 16 2021 3:18 PM
Is it possible to use an open query inside another open query ?
  1. SELECT * FROM OPENQUARY([Test],  
  2. 'SELECT * FROM HR.Employee  
  3. WHERE DeptID NOT IN   
  4. (SELECT * FROM OPENQUERY ([Test],''SELECT DISTINCT DeptID  
  5. FROM HR.Departments''))  
  6. ')  
It is throwing an error when calling the open query from PostgreSQL to SQL Server 

Answers (1)