Question

How to use Table variable into SQL query instead of sheetname

  • 15 March 2023
  • 1 reply
  • 14 views

Badge

Example is -- select * from [Sheet1$$];

 

I want to use Table Variable instead of Sheet1

I tried to using ---   select * from [Table variable$$];

 

It is not working , can anyone suggest solution


1 reply

Userlevel 5
Badge +9

 @ap442 

Declare a new variable which will contains the sheet name and use it into the select query as below

 

HTH

Regards

Reply