.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: Consolas, "Courier New", Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #a31515; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; } 1: SELECT 2: SO.object_id, 3: SO.name AS NomeTabela, 4: CAST 5: ((SELECT TOP 1 6: VALUE 7: FROM sys.fn_listextendedproperty('NomeTabelaTraduzido', 'schema', 'dbo', 'table', SO.name, NULL, NULL) AS fn_listextendedproperty_3) 8: AS varchar(MAX)) 9: AS NomeTabelaTraduzido, 10: SC.column_id AS ColunaOrdem, 11: SC.name AS NomeColuna, 12: CAST 13: ((SELECT TOP 1 14: VALUE 15: FROM sys.fn_listextendedproperty('MS_Description', 'schema', 'dbo', 'table', so.name, 'column', sc.name) AS fn_listextendedproperty_2) 16: AS varchar(MAX)) 17: AS DescricaoColuna, 18: (SELECT TOP 1 19: T.name 20: FROM sys.foreign_key_columns AS FK 21: INNER JOIN sys.tables AS T 22: ON FK.referenced_object_id = T.object_id 23: WHERE (FK.parent_object_id = SO.object_id) AND (FK.parent_column_id = SC.column_id)) 24: AS TabelaRelacionada, 25: (SELECT TOP 1 26: c.name 27: FROM sys.foreign_key_columns AS fk 28: INNER JOIN sys.columns AS c 29: ON c.column_id = fk.referenced_column_id AND c.object_id = fk.referenced_object_id 30: WHERE (fk.parent_object_id = SO.object_id) AND (fk.parent_column_id = SC.column_id)) 31: AS CampoCondicao, 32: CAST 33: ((SELECT TOP 1 34: VALUE 35: FROM sys.fn_listextendedproperty('CampoRetorno', 'schema', 'dbo', 'table', so.name, 'column', sc.name) AS fn_listextendedproperty_1) 36: AS varchar(MAX)) 37: AS CampoRetorno 38: FROM sys.objects AS SO 39: INNER JOIN sys.columns AS SC 40: ON SO.object_id = SC.object_id 41: WHERE (SO.type = 'U') 42: ORDER BY NomeTabela .csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: Consolas, "Courier New", Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; } 1: Declare @PageIndex int 2: Declare @PageSize int 3: set @PageIndex = 4; 4: set @PageSize = 7; 5: Select * From (SELECT ROW_NUMBER() OVER (Order by [column]) AS Linha, 6: [column..1], [column..2], [column..N] FROM [tabela] 7: WHERE Linha between (@PageIndex - 1) * @PageSize + 1 and 8: @PageIndex*@PageSize .csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: Consolas, "Courier New", Courier, Monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; } 1: SELECT 2: u.name + '.' + t.name AS [Tabela], 3: td.value AS [Descricao da Tabela], 4: c.name AS [Coluna], 5: cd.value AS [Descricao da Coluna] 6: FROM sysobjects t 7: INNER JOIN sysusers u ON u.uid = t.uid 8: LEFT OUTER JOIN sys.extended_properties td ON td.major_id = t.id