Hi,
How to added a column dynamically suppose if tabel_1 has 5 columns & another table table_2 has only 3 columns
when copying data from table_1 to table_2 throws error as
"The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns."
query
insert into ALTER2..table_2(X,Y,Z,xx)
SELECT * from table_1 where age='10''
for this with out declaring same no of columns as in table_1, when insertion it should dynamically check & add required no of columns according to table_1 & data type is it should as nvarchar(max) for newly added columns in table_2.
Thanks
SATHIYANARAYANAN