Hi CsharpCorner,
I need to add columns to an existing table by using the stored procedure. i.e by passing the tablename as a parameter i need to add the 3 columns by executing the stored procedure and update the columns with some values .please advise me...
Thanks
Hari


Raja TRank #685 · 3.5K reputationPosted Jul 7, 2016, 9:33 AM EDT
so u know what the columns names or not ? if yes/no means it can easy ...
when you calling SP with parameter table name and if you know what are the columns means send again another parameter
like fieldname...so u can write code likeas
begin
alter table 'tablename'
add 'columnname1' varchar size 100
add 'columnname2' varchar size 100
add 'columnname3' varchar size 100
end
Nitin SontakkeRank #264 · 9.6K reputationPosted Jul 7, 2016, 8:31 PM EDT
ketan borsdiyaRank #2,258 · 624 reputationPosted Jul 7, 2016, 9:18 PM EDT