How to identify identical columns with different names across tables?

ColinMac

My database has many columns that are reused across tables, but the name of the column changes.

edit: as an example: We're in telecom and deal with the 10 digit telephone number. It's used across 100s of tables, usually with a different column_name for each table, and the datatype and format of the column are not consistent (e.g. '123-456-7890', '1234567890', int 1234567890, 1800-123-456-7890).

For training and analysis, I want to be able to link or identify these duplicates with different names.

How can I do this?

Tab Alleman

example: I work in telecom and we use the telephone number in many different ways. That data point (the telephone number) is reused in literally 100s of tables, and it has dozens of different column names

Ok, no, SQL Server can't identify these columns automatically for you.

If you can come up with rules for programmatically identifying a telephone number column based on available metadata (in sys.columns, for instance) you can write a query that will get all such columns.

If you have to go through your columns and manually decide which ones are telephone number columns, you can start manually storing this information in a meta-table of your own design. Something like:

TableName    ColumnName    StandardName
Table1       Phone         PhoneNumber
Table2       HomePhone     PhoneNumber
Table2       WorkPhone     PhoneNumber

Where TableName and ColumnName are the actual names, and StandardName is a value you manually assign that will be the same "Standard" name for all the "Identical" columns.

And then this meta-table could be used/queried for reference, training and analysis.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

C# anonymous type for identical database tables with different names

From Dev

Getting values from different tables with identical columns into an array

From Dev

How to query across 2 different tables in Rails?

From Dev

How to append tables in Power Query while merging similar columns which have different names, types and order?

From Dev

How can I join two tables when the join columns have different names?

From Dev

How do I merge two tables in Excel that have identical columns?

From Dev

Fluent Nhibernate : Map one class to two identical tables but with different table names

From Dev

Why do sqlite columns have different names for views and tables?

From Dev

reporting identical values across columns in matrix

From Dev

Merge data from three or more identical columns of different tables into single column

From Dev

SQLite Sort across columns across tables

From Dev

how to identify names of the partitions

From Dev

how to identify names of the partitions

From Dev

aggregate columns across 3 tables

From Dev

aggregate columns across 3 tables

From Dev

Identify all common rows across columns

From Dev

identify and count duplicate values across multiple columns

From Dev

Identify all common rows across columns

From Dev

How specify join variables with different names in different MySQL tables

From Dev

How to group two tables by different columns?

From Dev

How to get the columns from three different tables?

From Dev

How to group two tables by different columns?

From Dev

How to display in listview columns from different tables

From Dev

Excel: How to merge tables (some columns are different)

From Dev

How does the sequence of inode numbers work? Can I expect consistency across identical installs on different computers?

From Dev

Merging columns from identical tables in SQL

From Dev

keeping 2 tables with 2 identical columns in sync

From Dev

Tables with identical styles have different widths

From Dev

Select 4 different named columns across 4 tables and return the count of all

Related Related

  1. 1

    C# anonymous type for identical database tables with different names

  2. 2

    Getting values from different tables with identical columns into an array

  3. 3

    How to query across 2 different tables in Rails?

  4. 4

    How to append tables in Power Query while merging similar columns which have different names, types and order?

  5. 5

    How can I join two tables when the join columns have different names?

  6. 6

    How do I merge two tables in Excel that have identical columns?

  7. 7

    Fluent Nhibernate : Map one class to two identical tables but with different table names

  8. 8

    Why do sqlite columns have different names for views and tables?

  9. 9

    reporting identical values across columns in matrix

  10. 10

    Merge data from three or more identical columns of different tables into single column

  11. 11

    SQLite Sort across columns across tables

  12. 12

    how to identify names of the partitions

  13. 13

    how to identify names of the partitions

  14. 14

    aggregate columns across 3 tables

  15. 15

    aggregate columns across 3 tables

  16. 16

    Identify all common rows across columns

  17. 17

    identify and count duplicate values across multiple columns

  18. 18

    Identify all common rows across columns

  19. 19

    How specify join variables with different names in different MySQL tables

  20. 20

    How to group two tables by different columns?

  21. 21

    How to get the columns from three different tables?

  22. 22

    How to group two tables by different columns?

  23. 23

    How to display in listview columns from different tables

  24. 24

    Excel: How to merge tables (some columns are different)

  25. 25

    How does the sequence of inode numbers work? Can I expect consistency across identical installs on different computers?

  26. 26

    Merging columns from identical tables in SQL

  27. 27

    keeping 2 tables with 2 identical columns in sync

  28. 28

    Tables with identical styles have different widths

  29. 29

    Select 4 different named columns across 4 tables and return the count of all

HotTag

Archive