I need to form a query that lists all the databases that include the words 'PRD' that have a single specific user name 'user_1'
So far I have this query:
select name as username,
type_desc as type,
authentication_type_desc as authentication_type
where type not in ('A', 'G', 'R', 'X')
and sid is not null
and name != 'guest'
and name = 'user_1'
order by username;
I need to combine it with the below query:
SELECT name FROM master.sys.databases
where name like '%PRD%'
How can I combine both?
Any help is appreciated.