In SQL server , Renaming a existing column without any data loss is possible .
A Inbuild System Stored Proc is available for the same
Syntax
EXEC sp_rename `tableName.[existingColumnName]`, `newColumnName`, `COLUMN`
Eg:
EXEC sp_rename `tblShortName.[longName]`, `shortName`, `COLUMN`
The above SP on execution will change the column longName in the tblShortName table to shortName
Note :
Take care you make the changes in all the stored proc and function where you are refering the old Column to the new Column
Subscribe to:
Post Comments (Atom)
Today’s most accurate tip for stock
ReplyDeleteBUY HINDALCO 120 PUT ABOVE 3.10 TG- 3.60/4.40/5.50 SL- 1.90
Free option tips
FUTURE DAFS POINT PLAN BUY NSE TITAN BTWN 852- 853 TARGET 862-872 SL 843
ReplyDeleteOUR FIRST TGT 862 ACHIEVED IN TITAN BUY CALL, ONCE BOOK PARTIAL PROFIT AND TRAIL SL AT COST
Stock Market Tips
MMMFS CASH CALL : SELL JINDALSTEL BELOW 155.5 TARGETS 154 , 152.5 , 151 STOPLOSS 158.5
ReplyDeleteCASH UPDATE : JINDALSTEL OUR 1ST TGT 154 ACHIEVED BOOK PARTIAL PROFIT
Stock Cash Tips