sp_rename Error

  • Please can anyone help me. I am trying to remname a column in a table. However I am getting the error

    " The parameter @oldname is either ambiguous or the claimed

    @itemtype (column) was wrong."

    I have tried changing it in EM & then saving the script. The column change is saved, but then when I try to runn the script against another db, I kepp getting this error.

    Does anyoneknow why?

    Thanks in advance.

  • Maybe the column type is different in the other db? Could you post the change script plus DDL for the db where it fails?

    Andy

  • Andy,

    I am soo sorry for not replying, my ISP went down, and then I was OOB.

    Here is the generated code:

    BEGIN TRANSACTION

    SET QUOTED_IDENTIFIER ON

    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE

    COMMIT

    BEGIN TRANSACTION

    EXECUTE sp_rename N'dbo.TaskStepType.TaskStepTypeCode', N'Tmp_TaskStepTypeID', 'COLUMN'

    GO

    EXECUTE sp_rename N'dbo.TaskStepType.Tmp_TaskStepTypeID', N'TaskStepTypeID', 'COLUMN'

    GO

    COMMIT

    And here is the tablescript:

    CREATE TABLE [dbo].[TaskStepType] (

    [TaskStepTypeCode] [int] NOT NULL ,

    [RecordDate] [datetime] NULL ,

    [TaskStepTypeText] [varchar] (50) NULL ,

    [TimeStamp] [timestamp] NULL

    ) ON [PRIMARY]

    GO

    ???

    Thanks for replying!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply