我有數據庫的名字,是像這樣:任何方式來簡化T-SQL中的這種LIKE通配符表達式,而不訴諸於CLR?
testdb_20091118_124925 testdb_20091119_144925 testdb_20091119_145925 ect...
有隻返回類似記錄,然後使用這個喜歡錶達的更優雅方式:
select * from sys.databases where name
LIKE 'testdb[_][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][_][0-9][0-9][0-9][0-9][0-9][0-9]'