/* Select ALL table names and column names from a given table. */
select o.name as [TableName], c.name as [ColumnName]
from sys.objects o
inner join sys.columns c ON o.object_id = c.object_id
where 0=0
and type = ‘U’
— and c.name like ‘%user%’
–and c.name = ‘person’
— select * from sys.columns where name like ‘%client%’
— select * from sys.objects
— if exists (select name from sys.tables = ‘Apples’)
— drop table Apples