0

I have try to use statement below in my SQL. Is it possible by any means to dynamically select table form database. (For example select table name from Comobox and then display data from selected table)

SET @var1 = 'test';
SELECT * From @var1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Sysrq147
  • 1,359
  • 4
  • 27
  • 49

1 Answers1

-2

Dynamic SQL requires that you create a string consisting of the sql statement, and then you execute the string. Dynamic t-sql quotes in string

Community
  • 1
  • 1
Tim
  • 8,669
  • 31
  • 105
  • 183