Rename the error of the SQL column: either the @objname parameter is ambiguous, or the declared @objtype code (COLUMN) is incorrect

I wanted to rename my column.

I called this document.

I wrote a query like:

sp_RENAME '[dbo].[File].[JSONFile]', '[ARAInputJson]', 'COLUMN'

But now the column is created as [ARAInputJson]

But I do not want to put square brackets.

So, I wrote this as:

sp_RENAME '[dbo].[File].[[ARAInputJson]]' , 'ARAInputJson', 'COLUMN'

But I get this error:

Msg 15248, level 11, state 1, sp_rename procedure, line 215
Either the @objname parameter is ambiguous, or the declared @objtype code (COLUMN) is incorrect.

Please help me rename the column from [ARAInputJson]to ARAInputJson.

+4
source share
3 answers

:

sp_RENAME 'dbo.File."[ARAInputJson]"' , 'ARAInputJson', 'COLUMN'
+3

[]

sp_RENAME 'dbo.File.[ARAInputJson]' , 'ARAInputJson', 'COLUMN'
+2
sp_RENAME '[dbo].[File].[[ARAInputJson]]]' , 'ARAInputJson', 'COLUMN'
+2

Source: https://habr.com/ru/post/1664550/


All Articles