Skip to content

SQL query on certain database names

I currently have many databases on a server. I want to run a query on only databases that end in “AccountsLive”. Not all of them end with this, so I kind of want to do a wildcard %AccountsLive query and not using a WHERE NOT name IN(‘master’, ‘tempdb’, ‘model’, …