listing all the views or tables of a database

navigating the sql management studio gui can be a bit of a pain when you don’t know the name of the table or view specifically that you’re looking for.  i was poking around looking for anything with the name “state” in it.

i finally decided to look into it, after procrastinating about it for months and months and months.  here it is:

for tables matching the word “state”:

select * from sys.tables where name like '%state%'

 

for views matching the word “state”:

select * from sys.views where name like '%state%'

Comments