Query table structure

xiaoxiao2021-03-14  177

============================================================================================================================================================================================================= ================================ - Table Structure information query

- Zou Jian 2005.08 (please keep this information) - ==================================== ===================================================== Select TableName = Case When C. Column_ID = 1 THEN O.NAME ELSE N '' End, TableDesc = ISNULL (CASE WHEN C.COLUMN_ID = 1 THEN PTB. [Value] end, n '), column_id = c.column_id, columnname = c.name Primarykey = isnull (idx.primarykey, n '), - [Identity] = Case When c.is_identity = 1 Then N'√'ELSE N' 'end, [Identity] = Case When C.Is_identity = 1 THEN N'IDENTITY (' RTRIM (Ident_seed (oname)) n', ' RTRIM (Ident_inCr (.NAME)) n') 'Else N' 'end, computed = case when c.is_computed = 1 Then n'√'lse n '' end, type = t.name, length = c.max_length, precision = c.Precision, Scale = C.scale, Nullable = Case when c.is_null = 1 Then n'√'lse N '' end, [default] = ISNULL (D.definition, n '), columnDesc = isnull (PFD. [Value], n'), indexname = isnull (idx.indexname, n '), indexsort = Isnull (idx.sort, n ''), create_date = o.create_date, modify_date = o.modify_datefrom sys.columns c in C. [object_id] = o. [Object_ID] A Nd o.type = 'u' and o.is_ms_shipped = 0 inner join sys.types t on c.user_type_id =

转载请注明原文地址:https://www.9cbs.com/read-129298.html

New Post(0)