Query to Change Column Name in sql server



I have created an Table Test with wrong column name as EepId instead of EmpID, and now i want to change it to EmpID, the following is the query to get
create table Test
(
EepID int
)
 insert into Test values(2)
 Now I want EepID column to Change to EmpID. The following is the solution
 EXEC sp_rename
    @objname = ‘Test.EepID’,
    @newname = ‘EmpID’,
    @objtype = ‘COLUMN’

Comments

Popular posts from this blog

Delete Confirmation for Delete ButtonField, TemplateField and CommandField in a GridView in ASP.NET

Selecting/Deselecting all CheckBoxes inside a ListView In ASP.NET

Remove Duplicate Chars From String