Home Forums SQL Server 7,2000 T-SQL SP_Rename column in different database RE: SP_Rename column in different database

  • One workaround.

    From your sp give a call to another sp in the target database and use sp_rename there.

    /*sp in first database where column name has changed already*/ 
    

    CREATE PROCEDURE dbo.a AS
    exec northwind.dbo.a
    GO

    /*and in northwind put in code to change the name of column*/

    CREATE PROCEDURE dbo.a AS
    exec sp_rename 'Table.ColumnOldName',
    'ColumnNewName' ,
    'Column'
    GO