Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL server info- extended properties

Author  Topic 

Shivan86
Starting Member

4 Posts

Posted - 2013-04-22 : 03:12:00
Lets say i have 3 databases of type Device(might be three different versions),which will have different names like (Device1, Device2, Device3). Now i want to query and get all databases of type Device, which should return these 3 dbs. How do i do it ?

I thought of adding it as a extended property. By adding name = type, and value= "Device" and querying this back?

Whats the best mechanism to do it? and if possible can someone give the query too.

thanks

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2013-04-22 : 03:25:48
Why do you want to go for extended properties?
If it just for naming a database,
Usually lot of us use the naming convention
for eg:if we have three warehouses,we name them as databasename_DW1,databasename_DW2 etc...
so that anytime you want to query all the warehouse you can just use the query like:
select name from sys.databases where name like '%DW%'

mohammad.javeed.ahmed@gmail.com
Go to Top of Page

Shivan86
Starting Member

4 Posts

Posted - 2013-04-22 : 03:41:51
hmm.. but i don't want to restrict them in naming.. Usually we keep different name for different sites. So if we are considering that scenario what is better ?
Go to Top of Page
   

- Advertisement -