SELECT
dbo.sysobjects.name as [Nom Table],
case dbo.sysobjects.xtype
when 'U' then 'Table'
when 'P' then 'Procédure'
end
as [Type Objects],
dbo.syscolumns.name as [Nom Colonne],
dbo.syscolumns.xtype as [Type de la Colonne],
case dbo.syscolumns.isnullable
when 0 then 'Non'
when 1 then 'Oui'
end as [Nul autorisé],
dbo.systypes.name as [Type de la Colonne],
dbo.systypes.length as [Longueur Max de la Colonne],
dbo.sysindexkeys.keyno as [Colonne index]
FROM
dbo.sysobjects
INNER JOIN dbo.syscolumns ON dbo.syscolumns.id = dbo.sysobjects.id
INNER JOIN dbo.systypes ON dbo.syscolumns.xtype =dbo.systypes.xtype
LEFT OUTER JOIN dbo.sysindexkeys ON dbo.sysindexkeys.id = dbo.syscolumns.id and sysindexkeys.colid=dbo.syscolumns.colid
WHERE
dbo.sysobjects.xtype = 'U'
and dbo.sysobjects.name =NomDeLaTable
order by syscolumns.xtype,syscolumns.name
Partager