String Search Patterns
The following system catalog functions support string search patterns:
•
dbo.fSQLForeignKeys
•
dbo.fSQLPrimaryKeys
•
dbo.fSQLStatistics
Two wildcard characters can be used in a search pattern:
•
Percent sign (%) represents any sequence of n characters.
•
Underscore (_) represents a single character.
Examples
The following table lists examples of using string search patterns.
Example Statement
Returns
SELECT * FROM dbo.fSQLStatistics ( null, ‘%’, 0 )
All tables with a unique index in current database
SELECT * FROM dbo.fSQLStatistics ( null, ‘t%’, 1 )
All tables starting with ‘t’ and an index in current database
SELECT * FROM dbo.fSQLPrimaryKeys ( null, ‘%’ )
All tables with a primary key in current database
SELECT * FROM dbo.fSQLPrimaryKeys ( null, ‘t%’ )
All tables starting with ‘t’ and a primary key in current database
SELECT * FROM dbo.fSQLForeignKeys ( null, ‘%’ , ‘%’ )
All tables with a primary key and corresponding foreign key tables in current database