I'm trying to rename a few columns within a table that's already created:
USE AdventureWorks
GO
EXEC sp_RENAME 'registration.StudentID', 'Temp', 'COLUMN';
GO
But I'm getting this error message:
Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.
If I omit 'COLUMN', this error appears:
No item by the name of 'registration.StudentID' could be found in the current database 'AdventureWorks', given that @itemtype was input as '(null)'.
I'm pretty sure that the StudentID column exists and has data in there. Can anyone help me out? Thanks!!!
registration.dbo.Enrollment.StudentID, Can you clarify the database, schema, table and column names?use registrationnotuse AdventureWorksandexec sp_rename 'dbo.enrollment.StudentID', 'Temp', 'COLUMN';then