SELECT dbo.syscolumns.name, dbo.syscolumns.colid AS columnID,dbo.sysobjects.ID AS TableID, dbo.systypes.name as DataType,case when dbo.syscolumns.autoval is not null then 1 else 0 end isautoval, dbo.syscolumns.prec ,dbo.syscolumns.isnullable ,dbo.syscolumns.scale,dbo.sysproperties.[value] AS Description FROM dbo.systypes RIGHT OUTER JOIN dbo.syscolumns ON dbo.systypes.xtype = dbo.syscolumns.xtype LEFT OUTER JOIN dbo.sysproperties ON dbo.syscolumns.id = dbo.sysproperties.id AND dbo.syscolumns.colid = dbo.sysproperties.smallid RIGHT OUTER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE systypes.xtype = systypes.xusertype and (dbo.sysobjects.xtype = 'u') AND (dbo.systypes.status <> 1) AND (dbo.sysobjects.id <> 1977058079) and dbo.sysobjects.name='hr_users' order by dbo.syscolumns.colid