views:

5

answers:

1

Hi,

I have Database mirroring setup between two SQl 2005 servers (no witness). Using Tsql, I want to find if there is a user database on both primary and mirror server. I can use the following on mirror:

select * from sys.databases where state <>1 and database_id>4

What should i use for Primary server?

Any help?

Regards

Manjot

+2  A: 

Use the dmvs associated with database mirroring

For example, sys.database_mirroring

gbn
Thank you very much.
Manjot