Solved

Gather list of databases

Posted on 2014-02-18
2
204 Views
Last Modified: 2014-02-18
Is there a way to obtain a list of database names programmatically that follow a certain naming convention?


For example, I want to obtain all databases that are named GHH_QA_CDR_<whatever>

db names
0
Comment
Question by:knowlton
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39868035
Give this T-SQL a whirl..
SELECT name 
FROM sys.databases
WHERE LEFT(name, 11) = 'GHH_QA_CDR_'   
ORDER BY name

Open in new window

0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 39868171
Yep!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now