BROKERS: Retrieve Tables with Properties
hassanhabib opened this issue · 0 comments
hassanhabib commented
Implement a DataBroker
that receives a string
as a query and returns List<dynamic>
IEnumerable<dynamic> SelectAllTablesWithProperties();
This here is what I did in the POC to implement this:
https://github.com/hassanhabib/EntityIntelligence.POC/blob/master/Standard.AI.Data/AIDataClient.cs#L39
SELECT TOP(250) T.name AS Table_Name ,\r\n C.name AS Column_Name ,\r\n P.name AS Data_Type ,\r\n C.max_length AS Size ,\r\n CAST(P.precision AS VARCHAR) + '/' + CAST(P.scale AS VARCHAR) AS Precision_Scale\r\nFROM sys.objects AS T\r\n JOIN sys.columns AS C ON T.object_id = C.object_id\r\n JOIN sys.types AS P ON C.system_type_id = P.system_type_id\r\nWHERE T.type_desc = 'USER_TABLE';