I need help with SQL Server Table Column.
I´m trying to rename Column Name, but this doesn’t work.
USE COST_mesta_test
GO
EXEC sp_rename '[dbo].[1965$].obec' , 'people' , 'COLUMN'
GO
I tried different combination of brackets [] and path to table “obec”
(for example: 1965.obec; 1965$.obec; 1965.[obec]; etc.)
But still i get an error:
Either the parameter @objname is ambiguous or the claimed @objtype
(COLUMN) is wrong.
I don’t really understand how your table is set up – ie. the table name, the column name etc – so this is an example of how the proc works for column renames:
If I had a table like this:
and wanted to change the
[CompanyName]column, this is the command:I suspect that your first argument is not correct.
From the documentation (sp_rename (Transact-SQL))