Controle de Numeração Doc
A tabela SD9 faz parte do sistema ERP Protheus da TOTVS e é utilizada para controle de numeração doc.
Ela pertence ao dicionário de dados do Protheus (SX2) e armazena informações essenciais utilizadas em processos como cadastros, movimentações e integrações do sistema.
A tabela SD9 possui diversos campos (SX3), cada um com regras específicas como tipo, tamanho e validações, além de índices (SIX) que otimizam a performance das consultas.
Nesta página você pode consultar a estrutura completa da tabela SD9, incluindo todos os campos e índices relacionados.
| Propriedade | Valor |
|---|---|
| X2_CHAVE | SD9 |
| X2_PATH | \DATA\ |
| X2_ARQUIVO | SD9990 |
| X2_NOME | Controle de Numeração Doc |
| X2_NOMESPA | Control de Numeración Doc. |
| X2_NOMEENG | Doc. Numbering Control |
| X2_ROTINA | - |
| X2_MODO | E |
| X2_MODOUN | E |
| X2_MODOEMP | E |
| X2_DELET | 0 |
| X2_TTS | - |
| X2_UNICO | - |
| X2_PYME | S |
| X2_MODULO | 5 |
| X2_DISPLAY | - |
| X2_SYSOBJ | - |
| X2_USROBJ | - |
| X2_POSLGT | 1 |
| X2_CLOB | 2 |
| X2_AUTREC | 2 |
| X2_TAMFIL | 2 |
| X2_TAMUN | 0 |
| X2_TAMEMP | 0 |
| X2_STAMP | 2 |
| X2_INSDT | 2 |
| D_E_L_E_T_ | - |
| R_E_C_N_O_ | 8150 |
| R_E_C_D_E_L_ | 0 |
| X3_ARQUIVO | X3_ORDEM | X3_CAMPO | X3_TIPO | X3_TAMANHO | X3_DECIMAL | X3_TITULO | X3_TITSPA | X3_TITENG | X3_DESCRIC | X3_DESCSPA | X3_DESCENG | X3_PICTURE | X3_VALID | X3_USADO | X3_RELACAO | X3_F3 | X3_NIVEL | X3_RESERV | X3_CHECK | X3_TRIGGER | X3_PROPRI | X3_BROWSE | X3_VISUAL | X3_CONTEXT | X3_OBRIGAT | X3_VLDUSER | X3_CBOX | X3_CBOXSPA | X3_CBOXENG | X3_PICTVAR | X3_WHEN | X3_INIBRW | X3_GRPSXG | X3_FOLDER | X3_PYME | X3_CONDSQL | X3_CHKSQL | X3_IDXSRV | X3_ORTOGRA | X3_IDXFLD | X3_TELA | X3_PICBRV | X3_AGRUP | X3_POSLGT | X3_MODAL | X3_CHKSUM | X3_ADDSUM | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SD9 | 01 | D9_FILIAL | C | 2 | 0 | Filial | Sucursal | Branch | Filial do Sistema | Sucursal del Sistema | System Branch | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | N | - | - | - | - | - | - | - | - | - | - | 033 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 131298 | 0 |
| SD9 | 02 | D9_DOC | C | 9 | 0 | Documento | Documento | Document | Numero de Documento | Numero de Documento | Document Number | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xxx | - | - | - | S | - | - | - | - | - | - | - | - | - | - | 018 | - | S | - | - | N | N | N | - | - | - | 1 | 1 | - | - | - | 131299 | 0 |
| SD9 | 03 | D9_SERIE | C | 3 | 0 | Serie | Serie | Serial | Serie do documento | Serie del documento | Serial Number of Document | !!! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | S | - | - | - | - | - | - | - | - | - | - | 094 | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 131300 | 0 |
| SD9 | 04 | D9_DTUSO | D | 8 | 0 | Data de Uso | Fecha de Uso | Date of Use | Data de Uso do Documento | Fecha de Uso del Docum. | Date of Use of Document | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 131301 | 0 |
| SD9 | 05 | D9_HORA | C | 6 | 0 | Hora de Uso | Hora de Uso | Time of Use | Hora de utilizacao do doc | Hora de utilizacion docum | Time of Use of Document | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 131302 | 0 |
| SD9 | 06 | D9_USUARIO | C | 25 | 0 | Usuario | Usuario | User | Usuario | Usuario | User | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | N | N | - | - | - | 1 | 2 | - | - | - | 131303 | 0 |
| SD9 | 07 | D9_MOTIVO | C | 50 | 0 | Motivo | Motivo | Reason | Motivo da nao geracao | Motivo de no generacion | Non generation reason | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | x x | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131304 | 0 |
| SD9 | 08 | D9_NSU | C | 10 | 0 | NSU | NSU | NSU | Numero Sequencial Unico | Numero secuencial unico | Single Sequential Number | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | x x | - | - | - | S | A | R | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131305 | 0 |
| SD9 | 09 | D9_CNPJ | C | 14 | 0 | CNPJ | RFC | CNPJ | Control.Numeracao CNPJ | Control.Numeracion RCPJ | CNPJ Numer Control | @!R NN.NNN.NNN/NNNN-99 | Vazio() .Or. CGC(M->D9_CNPJ) | x x x x x x x x x x x x x x x x | SM0->M0_CGC | - | 1 | x | - | - | - | S | V | R | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131306 | 0 |
| SD9 | 10 | D9_FILORI | C | 2 | 0 | Fil.Origem | Suc.Origen | Src. Branch | Filial Orig. do Documento | Sucursal Orig. Documento | Document Source Branch | - | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | S | V | R | - | - | - | - | - | - | - | - | 033 | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131307 | 0 |
| SD9 | 11 | D9_DOCEXCL | C | 1 | 0 | Doc.Excluído | Doc.Borrado | Deleted Doc. | Documento excluido | Documento borrado | Deleted document | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | - | A | R | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131308 | 0 |
| SD9 | 12 | D9_KEYNF | C | 50 | 0 | Chave NF | Clave NF | Inv Key | Chave de controle da NF | Clave control de Fact | Invoice Control Key | @! | - | x x x x x x x x x x x x x x x x | - | - | 1 | xx | - | - | - | - | V | R | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131309 | 0 |
| SD9 | 13 | D9_STATUS | C | 1 | 0 | Status | Estatus | Status | Status da numeração | Estatus de numeración | Numbering Status | @! | Pertence("1234") | x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | - | V | R | - | - | 1=Liberado para uso;2=Usado;3=Inutilizada;4=Cancelada | 1=Liberado para uso;2=Utilizado;3=Inutilizada;4=Anulada | 1=Released for use;2=Used;3=Disabled;4=Canceled | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131310 | 0 |
| SD9 | 14 | D9_MODELO | C | 2 | 0 | Modelo | Modelo | Model | Modelo do doc. fiscal | Modelo de Doc. Fiscal | Tax Doc Template | @! | - | x x x x x x x x x x x x x x x | - | - | 1 | x | - | - | - | - | V | R | - | - | - | - | - | - | - | - | - | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131311 | 0 |
| SD9 | 15 | D9_SDOC | C | 3 | 0 | Série Doc. | Serie Doc. | Inv. Series | Série do Documento Fiscal | Serie de Documento Fiscal | Invoice Series | !!! | - | x x x x x x x x x x x x x x x | - | - | 1 | xx x | - | - | - | N | V | R | - | - | - | - | - | - | - | - | 095 | - | S | - | - | N | - | N | - | - | - | 1 | 2 | - | - | - | 131312 | 0 |
| INDICE | ORDEM | CHAVE | DESCRICAO | DESCSPA | DESCENG | PROPRI | F3 | NICKNAME | SHOWPESQ | IX_VIRTUAL | IX_VIRCUST | D_E_L_E_T_ | R_E_C_N_O_ | R_E_C_D_E_L_ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SD9 | 1 | D9_FILIAL+D9_SERIE+DTOS(D9_DTUSO)+D9_DOC | Serie + Data de Uso + Documento | Serie + Fecha de Uso + Documento | Serial + Date of Use + Document | S | - | - | S | 2 | 3 | - | 18965 | 0 |
| SD9 | 2 | D9_FILIAL+D9_SERIE+D9_DOC+DTOS(D9_DTUSO)+D9_DOCEXCL | Serie + Documento + Data de Uso + Doc.Excluído | Serie + Documento + Fecha de Uso + Doc.Borrado | Serial + Document + Date of Use + Deleted Doc. | S | - | - | S | 2 | 3 | - | 18966 | 0 |
| SD9 | 3 | D9_FILIAL+D9_NSU+D9_SERIE+D9_DOC | NSU + Serie + Documento | NSU + Serie + Documento | NSU + Serial + Document | S | - | - | S | 2 | 3 | - | 18967 | 0 |
| SD9 | 4 | D9_CNPJ+D9_SERIE+DTOS(D9_DTUSO)+D9_DOC | CNPJ + Serie + Data de Uso + Documento | RFC + Serie + Fecha de Uso + Documento | CNPJ + Serial + Date of Use + Document | S | - | D9CNPJ1 | S | 2 | 3 | - | 18968 | 0 |
| SD9 | 5 | D9_CNPJ+D9_SERIE+D9_DOC+DTOS(D9_DTUSO) | CNPJ + Serie + Documento + Data de Uso | RFC + Serie + Documento + Fecha de Uso | CNPJ + Serial + Document + Date of Use | S | - | D9CNPJ2 | S | 2 | 3 | - | 18969 | 0 |
| SD9 | 6 | D9_FILIAL+D9_SDOC+DTOS(D9_DTUSO)+D9_DOC | Série Doc. + Data de Uso + Documento | Serie Doc. + Fecha de Uso + Documento | Inv. Series + Date of Use + Document | S | - | - | N | 2 | 3 | - | 18970 | 0 |
| SD9 | 7 | D9_FILIAL+D9_SDOC+D9_DOC+DTOS(D9_DTUSO) | Série Doc. + Documento + Data de Uso | Serie Doc. + Documento + Fecha de Uso | Inv. Series + Document + Date of Use | S | - | - | N | 2 | 3 | - | 18971 | 0 |
| SD9 | 8 | D9_FILIAL+D9_NSU+D9_SDOC+D9_DOC | NSU + Série Doc. + Documento | NSU + Serie Doc. + Documento | NSU + Inv. Series + Document | S | - | - | N | 2 | 3 | - | 18972 | 0 |
| SD9 | 9 | D9_CNPJ+D9_SDOC+DTOS(D9_DTUSO)+D9_DOC | CNPJ + Série Doc. + Data de Uso + Documento | RFC + Serie Doc. + Fecha de Uso + Documento | CNPJ + Inv. Series + Date of Use + Document | S | - | - | N | 2 | 3 | - | 18973 | 0 |
| SD9 | A | D9_CNPJ+D9_SDOC+D9_DOC+DTOS(D9_DTUSO) | CNPJ + Série Doc. + Documento + Data de Uso | RFC + Serie Doc. + Documento + Fecha de Uso | CNPJ + Inv. Series + Document + Date of Use | S | - | - | N | 2 | 3 | - | 18974 | 0 |
| SD9 | B | D9_FILIAL+D9_CNPJ+D9_SERIE+D9_MODELO+D9_STATUS+DTOS(D9_DTUSO) | CNPJ + Serie + Modelo + Status + Data de Uso | RFC + Serie + Modelo + Estatus + Fecha de Uso | CNPJ + Serial + Model + Status + Date of Use | S | - | - | S | 2 | 3 | - | 18975 | 0 |
Ela é utilizada para controle de numeração doc dentro do sistema ERP Protheus.
Nesta página você pode visualizar todos os campos, incluindo tipo, tamanho e validações.
Os índices são estruturas que melhoram a performance de busca e acesso aos dados dentro do Protheus.
Modelo de query gerado automaticamente com base na estrutura da tabela.
SELECT
D9_FILIAL,
D9_DOC,
D9_SERIE,
D9_DTUSO,
D9_HORA,
D9_USUARIO,
D9_MOTIVO,
D9_NSU,
D9_CNPJ,
D9_FILORI,
D9_DOCEXCL,
D9_KEYNF,
D9_STATUS,
D9_MODELO,
D9_SDOC
FROM SD9
WHERE
D_E_L_E_T_ = ' '
AND D9_FILIAL = 'VALOR'
AND D9_DOC = 'VALOR'
AND D9_SERIE = 'VALOR'
AND D9_DTUSO BETWEEN '20260501' AND '20260531'
AND D9_HORA = 'VALOR'
AND D9_USUARIO = 'VALOR'
AND D9_MOTIVO = 'VALOR'
AND D9_NSU = 'VALOR'
AND D9_CNPJ = 'VALOR'
AND D9_FILORI = 'VALOR'
AND D9_DOCEXCL = 'VALOR'
AND D9_KEYNF = 'VALOR'
AND D9_STATUS = 'VALOR'
AND D9_MODELO = 'VALOR'
AND D9_SDOC = 'VALOR'