How to Search all Columns in All Tables for a Specific GUID

Version 6

    Verified Product Versions

    Service Desk 7.8.xService Desk 2016.xAsset Manager 2016.x

    When a person has the guid for a specific business object instance, they often want to know where this object is related. This would require running a query for this information against the entire Service Desk database. There is no built in executable or stored procedure that accomplishes this. However, Narayana Vyas Kondreddi, a brilliant SQL developer, created an efficient stored procedure named "SearchAllTables" to accomplish this task. The original content of this stored procedure can be found at


    This stored procedure has been slightly modified so that it will include the "uniqueidentifier" data type that is used in all of the Service Desk guids.  The modified version is attached herewith.


    In order to make this work, the query syntax must first be run on the Service Desk database. This will create a stored procedure named "SearchAllTables." Then the user will execute the stored procedure by using the following syntax:


    EXEC SearchAllTables '{object guid}'


    This will scour all the tables in the Service Desk database for any instance of the guid. This can assist in showing you the relationships of this business object to other objects, and also assist in understanding the database structure.