I have setup mirroring for a database using SQL Server 2008 SP2.
When I look in the SQL Mgmt Studio my SQL1 server shows as (Principal, Synchronized) and my SQL2 server shows as (Mirror, Synchronized/Restoring...).
When I issue the follow T-SQL:
ALTER DATABASE [$(varDB)] SET PARTNER FAILOVER
The GUI shows the reverse. i.e SQL2 is now Principal and SQL1 is now Mirror.
Is there some T-SQL code I can use to show the Principal and Mirror status for the database?