sql - How do I retrieve a name of a database within a server? -


i have databases within server follows , want ger name of database s01_%, % latest date (the last part time).

enter image description here

bd_names() returns name of current database...

you can query sys.databases order name desc , using top 1 caluse.

select top 1 name sys.databases name 's01_%'  order name desc ; 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -