Hello, All.
I have a query where I am looking for tables that end in _AM.
I get back:
dbo Inspection_7152014_112102_AM
dbo Program
dbo Inspection_7152014_113629_AM
.
.
.
etc.
Is there a way to get this query to recognize the underscore?
I cannot perform my intended operation on the 'Program' table.
I am using SQL Server 2008.
Thanks, Everyone.
Patrick
I have a query where I am looking for tables that end in _AM.
Code:
SELECT sch.[name] AS SchemaName, tab.[name] AS TableName
FROM sys.Tables AS tab
JOIN sys.Schemas AS sch
ON tab.schema_id = sch.schema_id
WHERE tab.[name] LIKE '%_AM'
AND sch.[name] = 'dbo'
I get back:
dbo Inspection_7152014_112102_AM
dbo Program
dbo Inspection_7152014_113629_AM
.
.
.
etc.
Is there a way to get this query to recognize the underscore?
I cannot perform my intended operation on the 'Program' table.
I am using SQL Server 2008.
Thanks, Everyone.
Patrick