I have a query as shown below and it generates a temporary table automatically based on the parameter. Thus, the number of columns in this table may be different. Now I need to add the Auto incremental id column to this table. How am i doing this?
SELECT @SourceFields INTO
Note: 1) The source field number and table name are passed using the @SourceFields & @SourceTable . 2) Thus, the number of columns can be changed in the table ## StoreSourceInfo.
Current result:
select * from ##StoreSourceInfo shows only the available column.
Expected result: select * from ##StoreSourceInfo will display an additional column with an automatic incremental identifier and all other columns available in the temp table.
I hope you catch me. Thanks in advance.
source share