Sql-server – Find a string in a SQL Server database

sql server

I have an application which has logged an error like

Object <obj id> generated an exception.

The application store all its information in a SQL Server database which contains 100+ tables.

For sure somewhere there must be a table which contains all the objects of this type and I'm sure obj id is the key column there.

How can I find this object? Do I have to create 100+ SELECT queries to query each table or maybe there is a more convenient solution?

Best Answer

If I had to guess it's the object id for sys.objects. So

SELECT * FROM sys.objects WHERE object_id = <obj_id>

Specifically look at the name column (object name) and the type column (type of the object, for example U for user table, P for stored procedure etc).