Find an object in SQL Server (cross-database)

后端 未结 10 1197
太阳男子
太阳男子 2021-02-01 16:52

If I\'ve been told a table (or proc) name, but not which connected database the object is located in, is there any simple script to search for it? Maybe search somewhere in the

10条回答
  •  执念已碎
    2021-02-01 17:52

    select db_name(), * From sysobjects where xtype in ('U', 'P') And name = 'OBJECT_name'

    First column will display name of database where object is located at.

提交回复
热议问题