This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT '<TABELAS>' + | |
(SELECT | |
TABELA.NAME AS 'NOME' | |
, COLUNA.NAME AS 'NOME' | |
, CASE WHEN COLUNA.PRECISION > 0 THEN COLUNA.PRECISION ELSE COLUNA.MAX_LENGTH END AS 'TAMANHO' | |
, COLUNA.scale AS 'ESCALA' | |
, CASE COLUNA.IS_NULLABLE WHEN 1 THEN 'N' ELSE 'S' END AS 'OBRIGATORIO' | |
, CASE WHEN (SELECT COUNT(*) | |
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C | |
JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @QUERY_SELECT VARCHAR(MAX); | |
DECLARE @NOME_TABELA VARCHAR(MAX); | |
DECLARE @NOME_COLUNA VARCHAR(MAX); | |
DECLARE @VALOR_COLUNA VARCHAR(MAX); | |
DECLARE @QUERY_WHERE VARCHAR(MAX); | |
DECLARE @COLUNA_CHAVE VARCHAR(1); | |
DECLARE @COLUNA_EDITAVEL VARCHAR(1); | |
DECLARE @TIPO_COLUNA VARCHAR(MAX); | |
DECLARE @TEM_FILTRO BIT; | |
DECLARE @VALOR_NUMERICO VARCHAR(MAX); |