I am trying to create a helpful table because we have a lot of raw tables and views with business definitions.
for example the design for my v_ods_ACT_Master
would be
SELECT MBACCT AS [Account Number], ABCNAME AS [Business Name], dbo.ConvertDate(OBDTE) AS [Onboard Date]
FROM dbo.ods_ACT_Master
I want to the output to be a table like:
Feild | Business Name | Table |
---|---|---|
MBACCT | Account Number | ods_ACT_Master |
ABCNAME | Business Name | ods_ACT_Master |
OBDTE | Onboard Date | ods_ACT_Master |
ideally to create a table where I can add every one of my views so it would eventually be the end all be all key for business users.
Feild | Business Name | Table |
---|---|---|
MBACCT | Account Number | ods_ACT_Master |
ABCNAME | Business Name | ods_ACT_Master |
OBDTE | Onboard Date | ods_ACT_Master |
XYZCODE | Code 1 | ods_lkup_table1 |
PSNDOB | Date of Birth | ods_PersonEntity |
I tried to use sqlparse but while reading the documentation was not sure if it could do what I was looking for, seemed like it was more for splitting up the SELECT, FROM, and WHERE sections as opposed to reading and dissecting the select
snow is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.