Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Is it possible? Because there is no array in sql, I am trying to do something like
SET @SQL=' (select * from openquery ('+ @One +','' select * from state where (city in (select city from openquery ('+ @Two +','' select city from state_smaller '' ) ) ) with ur '' ) as A ) B '
*PS : just figured out how to keep formatting :)
umniza
Starting Member
19 Posts
Posted - 2010-07-07 : 15:37:45
formatting did not translate well...I was trying to show that I open connection 'One' and within it I want to open connection 'Two', so I can use its results in the outer select of the 'One'. I am getting error messages like "incorrect syntax near select" or "near ') "But I'm not even sure I can do openquery within openquery to begin with. If it's possible, could someone show me exact formatting with the apostrophes? Thank you!