How can I find all database objects in a given database using an object name? We prefix all site specific tables, views, indexes, functions, constraints etc. with a constant string. I need to find all objects with names starting with that string.
Use SQL Server Management Studio In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. To see a list of all databases on the instance, expand Databases.
The sysobjects view contains useful information about the different database objects.
Assuming you have the right permissions:
SELECT * FROM yourdatabasename.sys.all_objects WHERE upper(name) like upper('my prefix%') --use UPPER for case-INsensitivity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With