victorashi
IS-IT--Management
i need to update a table that i select dinamicaly
at update i need to acces the table's columns and asign eash a variable. here i'm stuck because i don't know how many columns the tables has, their names, and the variables i need to insert in them
-- if @a is the table that i imput
exec ('update '+@a' set --in this set i must acces the table's columns and asign each a variable
--i can make a query to give me the table's columns, like this:
select * from information_schema.columns where table_name =@a
but i still neet to put variables in the columns.
can u help me pls with thui dinamic update?
at update i need to acces the table's columns and asign eash a variable. here i'm stuck because i don't know how many columns the tables has, their names, and the variables i need to insert in them
-- if @a is the table that i imput
exec ('update '+@a' set --in this set i must acces the table's columns and asign each a variable
--i can make a query to give me the table's columns, like this:
select * from information_schema.columns where table_name =@a
but i still neet to put variables in the columns.
can u help me pls with thui dinamic update?