- Get link
- X
- Other Apps
Ao executar o comando SQL abaixo o retorno será a lista de colunas das tables de uma determinada instância do banco de dados.
SELECT
o.name AS [Table Name],
o.type,
c.name AS [Col Name],
s.name AS [ColType],
c.prec,
c.scale
FROM dbo.sysobjects o INNER JOIN
dbo.syscolumns c ON c.id = o.id INNER JOIN
dbo.systypes s ON c.xtype = s.xtype
WHERE (o.type = 'U')
SELECT
o.name AS [Table Name],
o.type,
c.name AS [Col Name],
s.name AS [ColType],
c.prec,
c.scale
FROM dbo.sysobjects o INNER JOIN
dbo.syscolumns c ON c.id = o.id INNER JOIN
dbo.systypes s ON c.xtype = s.xtype
WHERE (o.type = 'U')
Comments