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).
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
Post a Comment