Patti Johnson (9/4/2013)
Thank you so much for your help. I've been digging and digging so I appreciate your time.IF DATABASEPROPERTYEX('archer', 'Status') = 'ONLINE'
AND EXISTS(SELECT 1 FROM sys.database_mirroring WHERE database_id = DB_ID('archer') AND
(mirroring_role IS NULL OR mirroring_role <> 2))
BEGIN
use archer
SET NOCOUNT ON
END
Msg 954, Level 14, State 1, Line 6
The database "Archer" cannot be opened. It is acting as a mirror database.
Hmm, OK, let's ignore any db that is involved in mirroring then:
IF DATABASEPROPERTYEX('archer', 'Status') = 'ONLINE'
AND EXISTS(SELECT 1 FROM sys.database_mirroring WHERE database_id = DB_ID('archer') AND
mirroring_role IS NULL)
BEGIN
use archer
SET NOCOUNT ON
END
SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.