Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 22, 2015, 4:13 PM EDT
create table [NewTable] ( [old_column_1] int ,[new_column_1] varchar(max) -- new col at location ,[old_column_2] int ); insert into [NewTable] ( [old_column_1], [old_column_2] ) select [old_column_1], [old_column_2] from [OldTable] (nolock); drop table [OldTable]; sp_rename '[NewTable]', '[OldTable]';Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 22, 2015, 8:15 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 22, 2015, 8:55 PM EDT
shushil kumar70 reputationPosted Jun 22, 2015, 8:57 PM EDT
shushil kumar70 reputationPosted Jun 22, 2015, 8:57 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 22, 2015, 9:02 PM EDT
shushil kumar70 reputationPosted Jun 22, 2015, 9:05 PM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 22, 2015, 9:20 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 22, 2015, 9:20 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 22, 2015, 9:28 PM EDT
create table [NewTable] ( [old_column_1] int ,[new_column_1] varchar(max) -- new col at location ,[old_column_2] int ); insert into [NewTable] ( [old_column_1], [old_column_2] ) select [old_column_1], [old_column_2] from [OldTable] (nolock); drop table [OldTable]; sp_rename '[NewTable]', '[OldTable]';