Do you call the building to at ease when a sergeant major enters and there is an officer in the building?

Yes you do. Example would be if you are at your company. including your company commander, lets just say hanging around then all of a sudden the Brigade Sergeant Major pops in for a visit. The first person to see him calls the company to at ease, by loudly saying "At Ease". Any officer out ranks any nco. At the same time a Brigade is a higher echelon then a Company or a Battalion. So that being said give respect to your boss and his boss and his bosses boss