IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'SortNumber'
    WHERE SysObjects.Name = 'ConferenceRoomTypes'
)
  ALTER TABLE ConferenceRoomTypes ADD SortNumber INT NULL 
GO

DECLARE @ConferenceRoomTypeNumber INT
DECLARE @idx INT

DECLARE db_cur CURSOR STATIC FOR
  SELECT ConferenceRoomTypeNumber
  FROM ConferenceRoomTypes WITH (NOLOCK)
  ORDER BY Type
OPEN db_cur

FETCH NEXT FROM db_cur INTO @ConferenceRoomTypeNumber

SET @idx = 1

WHILE @@FETCH_STATUS = 0
BEGIN 
  UPDATE ConferenceRoomTypes SET SortNumber = @idx WHERE ConferenceRoomTypeNumber = @ConferenceRoomTypeNumber
  SET @idx = @idx + 1
  FETCH NEXT FROM db_cur INTO @ConferenceRoomTypeNumber
END

CLOSE db_CUR
DEALLOCATE db_cur