Use [EnVisage] IF (EXISTS (SELECT * FROM sys.tables where name='NonProjectTimeAllocation')) begin exec sp_rename 'NonProjectTimeAllocation', 'NonProjectTimeResourceAllocation' end GO