use Envisage
go
IF (EXISTS (SELECT * 
                 FROM INFORMATION_SCHEMA.TABLES 
                 WHERE TABLE_NAME = 'GLAccount'))
set noexec on
begin transaction
	EXEC sp_rename 'dbo.GLDepartment', 'GLAccount';
	go
	EXEC sp_rename 'dbo.GLDepartmentAccess', 'GLAccountAccess';
	go
	EXEC sp_rename 'dbo.Team.GLDepartmentId', 'GLAccountId', 'COLUMN';
	go
	EXEC sp_rename 'dbo.Company2GLDepartment.GLDepartmentId', 'GLAccountId', 'COLUMN';
	go
commit transaction