[AdvanceQuery] Is Openquery supported?

[AdvanceQuery] Is Openquery supported?

  

Hi,

Why when i do  SELECT ID FROM {Teste} it works but when i do

SET @Query = ('SELECT '+@ColumnName+' FROM {Teste}')

EXEC (@Query)

When i hit Test it gives me an error " Invalid column name 'ID' "

Hi Joao,

Did you set the @ColumnName's "Expand Inline" to Yes?

Solution

Yes,

Instead of define the query into a var and then execute, I tried to change to directly  Select @ColumnName From {Teste} with Expand inline on @ColumnName and it works.

Thanks

Solution