4
votes

I wanted to rename my column.

I referred this document.

I wrote a query as:

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

But now column is created as [ARAInputJson]

But I don't want to put square brackets to it.

So again I wrote it as :

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

But I get this error :

Msg 15248, Level 11, State 1, Procedure sp_rename, Line 215
Either the parameter @objname is ambiguous or the claimed @objtype (COLUMN) is wrong.

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

3

3 Answers

3
votes

This should solve your square bracket issue:

sp_RENAME 'dbo.File."[ARAInputJson]"' , 'ARAInputJson', 'COLUMN'
2
votes

Well remove all those [] and try like

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