```sql CREATE VIEW dbo.vw_db_dictionary AS SELECT o.name AS table_name, p.[value] AS table_desc, c.name AS field, cp.[value] AS field_desc, t.name AS field_type, c.length AS field_size, ISNULL(COLUMNPROPERTY(c.id, c.name, 'Scale'), 0) AS field_precision, c.isnullable AS nullable, ISNULL(COLUMNPROPERTY(c.id, c.name, 'IsIdentity'), 0) AS is_identity, CASE WHEN EXISTS ( SELECT 1 FROM sysobjects pk JOIN sysindexes i ON pk.name = i.name JOIN sysindexkeys ik ON i.indid = ik.indid WHERE ik.id = c.id AND ik.colid = c.colid AND pk.xtype = 'PK' ) THEN 1 ELSE 0 END AS is_key, ISNULL(cm.text, '') AS default_value FROM syscolumns c JOIN sysobjects o ON c.id = o.id JOIN systypes t ON c.xtype = t.xtype LEFT JOIN sysproperties p ON o.id = p.id AND p.smallid = 0 LEFT JOIN sysproperties cp ON c.id = cp.id AND c.colid = cp.smallid LEFT JOIN syscomments cm ON c.cdefault = cm.id WHERE o.xtype = 'U' ORDER BY o.name, c.colid; ```