Mark Minasi's Tech Forum
Register Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
cspanburgh

Avatar / Picture

Senior Member
Registered:
Posts: 237
Reply with quote  #1 

This script from the famous Pinal Dave from SQL authority really helped me.
Pinal Dave had many articles in SQL Server MAG years ago , but for some reason they dropped his contributions to the magazine.  IMHO, that was unfortunate.

A non documented CRM 2013 on premise instance has many customizations in entities and tables in production. 

In CRM the entity is called Event Session attendee, but in the SQL CRM Production database, the table is called: "altold_evt_sessionregistrantBase".

Just two changes to alter the script and I found the correct table.   I was getting nowhere trying to guess which of the many custom tables there were.   This was a big help.

USE
CRMProduction_MSCRM

GO

SELECT t.name AS table_name,

SCHEMA_NAME(schema_id)ASschema_name,

c.name AS column_name

FROMsys.tablesAS t

INNERJOINsys.columns c ON t.OBJECT_ID= c.OBJECT_ID

WHERE c.name LIKE'%painfull_registrationstatus%'

ORDERBYschema_name, table_name;

You can find the script at: https://blog.sqlauthority.com/2008/08/06/sql-server-query-to-find-column-from-all-tables-of-database/


__________________
Curt Spanburgh
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.