728x90
728x170

SELECT 'RX', E.Table_Name, E.Column_Name, E.Column_Order, E.Data_Type, E.Data_Length, E.Nullable--,E.Data_Scale,  F.Text Data_Default
  FROM (
   SELECT C.Table_Name
     , C.Column_Name
     , C.Column_Order
     , D.Name Data_Type
     , C.Data_Length
     , C.Data_scale
     , (CASE WHEN C.IsNullable = 0 THEN 'N' ELSE 'Y' END) Nullable
     , C.cdefault
     FROM (
     SELECT A.Name  Table_Name
       , B.Name  Column_Name
       , B.Colorder Column_Order
       , B.Prec  Data_Length
       , B.Scale  Data_scale
       , B.IsNullable
       , B.cdefault
       , B.xType
       FROM dbo.SysObjects A, dbo.SysColumns B
      WHERE A.ID = B.ID
        AND A.Type = 'U'
     ) C
   LEFT OUTER JOIN dbo.SysTypes D ON (C.xType = D.xType AND D.Name <> 'SysName')
  ) E
LEFT OUTER JOIN dbo.SysComments F ON (E.cdefault = F.ID)
WHERE E.Table_Name IN('Adjust', 'AlertResult','AppMemo','AppNote','AppTime','Board','ChartClose','CID','Document'
,'Family','Patient','Picture','PreReceipt','Prescription','Recall','RecallResult','Receipt','ReceiptCalc','ReceiptPlan','SMS','SMSData')
ORDER BY E.Table_Name, E.Column_Order

728x90
그리드형
Posted by kjun.kr
,