trigger

  • matt.newman (10/30/2012)


    Sorry, trying to do a few things but overall

    declare @insertednif and @deletednif

    select via select

    if insertednif <> deletednif

    begin

    rollback

    return

    end

    no no no. You do not want to use variables like this in a trigger. That is a sign of only handling single row updates. You need to deal with the whole set.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • river1 (10/30/2012)


    The code:

    update

    contribuintes

    set

    nif = c.nif

    from

    contribuintes c

    join

    inserted i

    on

    i.nif_antigo = c.nif_antigo

    where

    i.numeroposto = 'Central'

    Has a problem.

    I want that If the value from NIF is changed, then it needs to get back to the original value again.

    So, why use the inserted instead of the deleted table?

    You need to look at inserted to know if the new value of numeroposto = 'Central'. It actually doesn't matter if the new value for nif is the same or not, you want the old value either way. Keep in mind I can't actually test anything here, I am coding 100% blind because we don't have any ddl.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • I think this should do what you are looking for but it is untested because I don't have ddl to work with.

    create trigger TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF on contribuintes

    for update

    as begin

    update contribuintes

    set nif = d.nif

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.numeroposto = 'Central'

    update contribuintes

    set cod_rep_fiscal = d.cod_rep_fiscal

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.cod_rep_fiscal not in (select cod_rep_fiscal from V_RETURN_RF)

    end

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sean Lange (10/30/2012)


    I think this should do what you are looking for but it is untested because I don't have ddl to work with.

    create trigger TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF on contribuintes

    for update

    as begin

    update contribuintes

    set nif = d.nif

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.numeroposto = 'Central'

    update contribuintes

    set cod_rep_fiscal = d.cod_rep_fiscal

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.cod_rep_fiscal not in (select cod_rep_fiscal from V_RETURN_RF)

    end

    I think that we have a problem with that code sample....

    How will the trigger knows which NIFs should it updates on table contribuintes?

    Example:

    My table contribuintes have the following columns:

    NIF; NIF_ANTIGO (it's the primary key); NAME; ADDRESS; COD_REP_FISCAL,etc...

    When I update a NIF, the trigger should only update the NIF column with values from the deleted table to NIFs where nif_antigo is the same as the nif_antigo from deleted table.

    Otherwise, When an update happens, all the fields NIF from the table contribuintes will be updated with the NIF from the deleted table.

    This is not correct.

    Only does NIFs that were updated should get their values back to normal (nifs on the deleted table).

    The key to do this is the nif_antigo present on tables deleted and contribuintes.

    How can I change the code do accomplish this?

    Thank you very much.

  • river1 (11/6/2012)


    Sean Lange (10/30/2012)


    I think this should do what you are looking for but it is untested because I don't have ddl to work with.

    create trigger TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF on contribuintes

    for update

    as begin

    update contribuintes

    set nif = d.nif

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.numeroposto = 'Central'

    update contribuintes

    set cod_rep_fiscal = d.cod_rep_fiscal

    from inserted i

    join deleted d on d.SomeID = i.SomeID

    where i.cod_rep_fiscal not in (select cod_rep_fiscal from V_RETURN_RF)

    end

    I think that we have a problem with that code sample....

    How will the trigger knows which NIFs should it updates on table contribuintes?

    Example:

    My table contribuintes have the following columns:

    NIF; NIF_ANTIGO (it's the primary key); NAME; ADDRESS; COD_REP_FISCAL,etc...

    When I update a NIF, the trigger should only update the NIF column with values from the deleted table to NIFs where nif_antigo is the same as the nif_antigo from deleted table.

    Otherwise, When an update happens, all the fields NIF from the table contribuintes will be updated with the NIF from the deleted table.

    This is not correct.

    Only does NIFs that were updated should get their values back to normal (nifs on the deleted table).

    The key to do this is the nif_antigo present on tables deleted and contribuintes.

    How can I change the code do accomplish this?

    Thank you very much.

    Have you tested this code? It does NOT update the entire table. It is using the inserted and deleted tables. Those will contain the row(s) that were updated.

    I think you just need to change your join to use nif_antigo??? I don't know what your keys are because you still have not posted any ddl and sample data. I have coded this completely in a vacuum.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Hi,

    The table ddl is:

    USE [SGCTCentral]

    GO

    /****** Object: Table [dbo].[CONTRIBUINTES] Script Date: 11/07/2012 11:46:02 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_PADDING ON

    GO

    CREATE TABLE [dbo].[CONTRIBUINTES](

    [NIF] [varchar](20) NULL,

    [FILIAL_NUMBER] [char](1) NULL,

    [NIF_ANTIGO] [varchar](20) NOT NULL,

    [STATUS] [varchar](2) NULL CONSTRAINT [DF_RECADASTROS_STATUS] DEFAULT ('W'),

    [COD_GRP_CONTRIBUINTE] [varchar](4) NULL,

    [COD_MET_TRIBUTARIO] [varchar](10) NULL,

    [COD_TP_SINGULARES] [varchar](5) NULL,

    [COD_TP_IMPOSTOS] [varchar](5) NULL,

    [GRANDE_CONTRIBUINTE] [char](1) NULL,

    [NOME] [varchar](100) NULL,

    [MORADA] [varchar](510) NULL,

    [CIDADE] [varchar](100) NULL,

    [C_POSTAL] [varchar](8) NULL,

    [TELEFONE] [varchar](30) NULL,

    [FAX] [varchar](30) NULL,

    [COD_PROVINCIA] [varchar](4) NULL,

    [COD_MUNICIPIO] [varchar](4) NULL,

    [COD_REP_FISCAL] [varchar](5) NULL,

    [COD_COMUNA] [varchar](6) NULL,

    [DT_INICIO] [datetime] NOT NULL,

    [DT_ALTERACAO] [datetime] NULL,

    [DT_CESSACAO] [datetime] NULL,

    [COD_MOT_CESSACAO] [varchar](10) NULL,

    [MOT_CESSACAO] [varchar](255) NULL,

    [COD_TP_INSTITUICAO] [varchar](10) NULL,

    [COD_FUNC] [int] NULL,

    [COD_BAIRRO] [varchar](9) NULL,

    [COD_CIDADE] [varchar](5) NULL,

    [OBS] [varchar](255) NULL,

    [DT_BEGIN] [datetime] NULL,

    [NUMEROPOSTO] [varchar](10) NULL,

    [DT_EXPORT] [datetime] NULL,

    [FLAG] [varchar](5) NULL,

    CONSTRAINT [PK_CONTRIBUINTES] PRIMARY KEY NONCLUSTERED

    (

    [NIF_ANTIGO] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    SET ANSI_PADDING OFF

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_BAIRROS] FOREIGN KEY([COD_BAIRRO])

    REFERENCES [dbo].[BAIRROS] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_BAIRROS]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_CIDADES] FOREIGN KEY([COD_CIDADE])

    REFERENCES [dbo].[CIDADES] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_CIDADES]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_COMUNAS] FOREIGN KEY([COD_COMUNA])

    REFERENCES [dbo].[COMUNAS] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_COMUNAS]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_MOT_CESSACAO] FOREIGN KEY([COD_MOT_CESSACAO])

    REFERENCES [dbo].[MOT_CESSACAO] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_MOT_CESSACAO]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_MUNICIPIOS] FOREIGN KEY([COD_MUNICIPIO])

    REFERENCES [dbo].[MUNICIPIOS] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_MUNICIPIOS]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_PROVINCIAS] FOREIGN KEY([COD_PROVINCIA])

    REFERENCES [dbo].[PROVINCIAS] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_PROVINCIAS]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_REP_FISCAIS] FOREIGN KEY([COD_REP_FISCAL])

    REFERENCES [dbo].[REP_FISCAIS_] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_REP_FISCAIS]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [FK_CONTRIBUINTES_TP_INSTITUICOES] FOREIGN KEY([COD_TP_INSTITUICAO])

    REFERENCES [dbo].[TP_INSTITUICOES] ([CODIGO])

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [FK_CONTRIBUINTES_TP_INSTITUICOES]

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] WITH NOCHECK ADD CONSTRAINT [CK1_RECADASTROS] CHECK (([STATUS] = 'W' or [STATUS] = 'A' or [STATUS] = 'C' or [STATUS] = 'R' or [STATUS] = 'I'))

    GO

    ALTER TABLE [dbo].[CONTRIBUINTES] CHECK CONSTRAINT [CK1_RECADASTROS]

    This table also has a trigger.

    The code is:

    ALTER TRIGGER [dbo].[TRG_CONTRIBUINTES_TRILHA_ALTERACOES_INS] ON [dbo].[CONTRIBUINTES]

    FOR UPDATE

    AS

    declare @Continua as char(1)

    Set @Continua = 'T'

    if @Continua = 'T'

    begin

    declare @IS_CENTRAL char(1)

    select @IS_CENTRAL = IS_CENTRAL from parametros

    --Apenas preenche as alterações se não está na Central

    if @IS_CENTRAL <> 'T'

    begin

    Declare @NewValue As VarChar(200)

    Declare @OldValue As VarChar(200)

    Declare @NIF_ANTIGO as varchar(20)

    Select @NIF_ANTIGO = NIF_ANTIGO from inserted

    IF UPDATE (NIF)

    begin

    Select @NewValue = NIF from inserted

    Select @OldValue = NIF from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'NIF', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (STATUS)

    begin

    Select @NewValue = case STATUS

    when 'A' then 'Activo'

    when 'C' then 'Cessado'

    when 'I' then 'Inactivo' end

    from inserted

    Select @OldValue = case STATUS

    when 'A' then 'Activo'

    when 'C' then 'Cessado'

    when 'I' then 'Inactivo' end

    from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'STATUS', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_GRP_CONTRIBUINTE)

    begin

    Select @NewValue = gc.DESCRICAO from inserted i join grupos_contribuintes gc on i.cod_grp_contribuinte = gc.codigo

    Select @OldValue = gc.DESCRICAO from deleted d join grupos_contribuintes gc on d.cod_grp_contribuinte = gc.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Grupo de Contribuintes', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_MET_TRIBUTARIO)

    begin

    Select @NewValue = mt.DESCRICAO from inserted i join met_tributarios mt on i.cod_met_tributario = mt.codigo

    Select @OldValue = mt.DESCRICAO from deleted d join met_tributarios mt on d.cod_met_tributario = mt.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Mét. Tributário', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_TP_SINGULARES)

    begin

    Select @NewValue = ts.DESCRICAO from inserted i join tp_singulares ts on i.cod_tp_singulares = ts.codigo

    Select @OldValue = ts.DESCRICAO from deleted d join tp_singulares ts on d.cod_tp_singulares = ts.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Tipo de Singular', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_TP_IMPOSTOS)

    begin

    Select @NewValue = ti.DESCRICAO from inserted i join tp_impostos ti on i.cod_tp_impostos = ti.codigo

    Select @OldValue = ti.DESCRICAO from deleted d join tp_impostos ti on d.cod_tp_impostos = ti.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Tipo de Imposto', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (NOME )

    begin

    Select @NewValue = NOME from inserted

    Select @OldValue = NOME from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'NOME', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (MORADA)

    begin

    Select @NewValue = MORADA from inserted

    Select @OldValue = MORADA from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Morada', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (CIDADE)

    begin

    Select @NewValue = CIDADE from inserted

    Select @OldValue = CIDADE from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Cidade', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_PROVINCIA)

    begin

    Select @NewValue = p.DESCRICAO from inserted i join provincias p on i.cod_provincia = p.codigo

    Select @OldValue = p.DESCRICAO from deleted d join provincias p on d.cod_provincia = p.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Provincia', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_MUNICIPIO )

    begin

    Select @NewValue = m.DESCRICAO from inserted i join municipios m on i.cod_municipio = m.codigo

    Select @OldValue = m.DESCRICAO from deleted d join municipios m on d.cod_municipio = m.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Municipio', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_REP_FISCAL)

    begin

    Select @NewValue = r.DESCRICAO from inserted i join rep_fiscais r on i.cod_rep_fiscal = r.codigo

    Select @OldValue = r.DESCRICAO from deleted d join rep_fiscais r on d.cod_rep_fiscal = r.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Rep. Fiscal', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_COMUNA)

    begin

    Select @NewValue = c.DESCRICAO from inserted i join comunas c on i.cod_comuna = c.codigo

    Select @OldValue = c.DESCRICAO from deleted d join comunas c on d.cod_comuna = c.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Comuna', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (COD_MOT_CESSACAO)

    begin

    Select @NewValue = ms.DESCRICAO from inserted i join mot_cessacao ms on i.cod_mot_cessacao = ms.codigo

    Select @OldValue = ms.DESCRICAO from deleted d join mot_cessacao ms on d.cod_mot_cessacao = ms.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Motivo Cessação', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (MOT_CESSACAO)

    begin

    Select @NewValue = ms.DESCRICAO from inserted i join mot_cessacao ms on i.cod_mot_cessacao = ms.codigo

    Select @OldValue = ms.DESCRICAO from deleted d join mot_cessacao ms on d.cod_mot_cessacao = ms.codigo

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Motivo Cessação', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (MOT_CESSACAO)

    begin

    Select @NewValue = MOT_CESSACAO from inserted

    Select @OldValue = MOT_CESSACAO from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Motivo Cessação', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    IF UPDATE (OBS)

    begin

    Select @NewValue = OBS from inserted

    Select @OldValue = OBS from deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    Values (@NIF_ANTIGO, 'Observações', getdate(), @OldValue, @NewValue)

    Set @NewValue = null

    Set @OldValue = null

    end

    end

    end

    else

    begin

    Declare @MSG varchar (100)

    set @MSG = 'Já existe um Contribuinte com o mesmo NOME '

    RAISERROR ( @MSG, 11, 1)

    ROLLBACK TRANSACTION

    end

    The problem is that when I try to update the table with my new trigger it takes a lot of time and the operation is not finished...

    This is the new trigger that I have created with your help:

    ALTER trigger [dbo].[TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF]

    on [dbo].[CONTRIBUINTES]

    for update

    as

    update contribuintes

    set

    nif = d.nif,

    filial_number = d.filial_number

    from

    inserted i join deleted d

    on

    d.nif_antigo = i.nif_antigo

    where

    i.numeroposto = 'Central'

    update contribuintes

    set

    cod_rep_fiscal = d.cod_rep_fiscal

    from

    inserted i join deleted d

    on

    d.nif_antigo = i.nif_antigo

    where

    i.cod_rep_fiscal not in (select codigo from V_RETURN_RF)

    and

    i.numeroposto = 'Central'

  • I dont understand the code below:

    update contribuintes

    set

    nif = d.nif,

    filial_number = d.filial_number

    from

    inserted i join deleted d

    on

    d.nif_antigo = i.nif_antigo

    where

    i.numeroposto = 'Central'

    Shouldn't I tell the table contribuintes to update only the NIFs where the column nif_antigo be equals to the column deleted.nif_antigo?

    When I try to change the values from the table using the application the operation is never completed.

    If I delete this new trigger then the operations completes with no problem.

  • This table also has a trigger.

    The code is:

    Your trigger needs to be completely rewritten. You can't handle multiple row updates. This whole thing needs to be set based or you are in for trouble down the line. I tossed together what I think the first portion could look like. I also moved the error logic to the top to simplify that piece.

    ALTER TRIGGER [dbo].[TRG_CONTRIBUINTES_TRILHA_ALTERACOES_INS] ON [dbo].[CONTRIBUINTES]

    FOR UPDATE

    AS

    BEGIN

    --DECLARE @IS_CENTRAL CHAR(1)

    --SELECT @IS_CENTRAL = IS_CENTRAL

    --FROM parametros

    --Apenas preenche as alterações se não está na Central

    IF EXISTS(select * from parametros where IS_CENTRAL = 'T')--@IS_CENTRAL <> 'T'

    BEGIN

    DECLARE @MSG VARCHAR(100)

    SET @MSG = 'Já existe um Contribuinte com o mesmo NOME '

    RAISERROR (@MSG, 11, 1)

    ROLLBACK TRANSACTION

    END

    ELSE

    BEGIN

    --DECLARE @NewValue AS VARCHAR(200)

    --DECLARE @OldValue AS VARCHAR(200)

    --DECLARE @NIF_ANTIGO AS VARCHAR(20)

    --SELECT @NIF_ANTIGO = NIF_ANTIGO

    --FROM inserted

    IF

    UPDATE (NIF)

    BEGIN

    --SELECT @NewValue = NIF

    --FROM inserted

    --SELECT @OldValue = NIF

    --FROM deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    select i.NIF, 'NIF', getdate(), d.NIF

    from inserted i

    join deleted d on d.nif_antigo = i.nif_antigo

    --VALUES (

    --@NIF_ANTIGO

    --,'NIF'

    --,getdate()

    --,@OldValue

    --,@NewValue

    --)

    --SET @NewValue = NULL

    --SET @OldValue = NULL

    END

    IF

    UPDATE (STATUS)

    BEGIN

    --SELECT @NewValue = CASE STATUS

    --WHEN 'A'

    --THEN 'Activo'

    --WHEN 'C'

    --THEN 'Cessado'

    --WHEN 'I'

    --THEN 'Inactivo'

    --END

    --FROM inserted

    --SELECT @OldValue = CASE STATUS

    --WHEN 'A'

    --THEN 'Activo'

    --WHEN 'C'

    --THEN 'Cessado'

    --WHEN 'I'

    --THEN 'Inactivo'

    --END

    --FROM deleted

    INSERT INTO trilha_alteracoes (nrpc, campo, dt_alteracao, valor_old, valor_new)

    select i.nif_antigo, 'STATUS', GETDATE(),

    Case d.STATUS when 'A' then 'Activo' when 'C' then 'Cessado' when 'I' then 'Inactivo' end,

    Case i.STATUS when 'A' then 'Activo' when 'C' then 'Cessado' when 'I' then 'Inactivo' end

    from inserted i

    join deleted d on d.NIF_ANTIGO = i.NIF_ANTIGO

    --VALUES (

    --@NIF_ANTIGO

    --,'STATUS'

    --,getdate()

    --,@OldValue

    --,@NewValue

    --)

    --SET @NewValue = NULL

    --SET @OldValue = NULL

    END

    --You get the idea at this point.

    In fact, your whole trigger looks like an attempt at logging changes into an EAV style table. This is a complete pain to deal with when you need to actually evaluate this data. How can you put a row together from a given data to see what it looked like? Wouldn't it be far simpler to just log the whole row? Create an audit table that looks just like the original with the additional of "dt_alteracao". Then the entire contents of your trigger are this:

    IF EXISTS(select * from parametros where IS_CENTRAL = 'T')

    BEGIN

    DECLARE @MSG VARCHAR(100)

    SET @MSG = 'Já existe um Contribuinte com o mesmo NOME '

    RAISERROR (@MSG, 11, 1)

    ROLLBACK TRANSACTION

    END

    ELSE

    BEGIN

    Insert CONTRIBUINTES_alteracoes

    select *, getdate() from deleted --of course don't use *, list all the columns

    END

    That will log the entire row every time. There is no need to use any of the data from inserted, that is either in the next row in the log table OR in the actual table.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • river1 (11/7/2012)


    I dont understand the code below:

    update contribuintes

    set

    nif = d.nif,

    filial_number = d.filial_number

    from

    inserted i join deleted d

    on

    d.nif_antigo = i.nif_antigo

    where

    i.numeroposto = 'Central'

    Shouldn't I tell the table contribuintes to update only the NIFs where the column nif_antigo be equals to the column deleted.nif_antigo?

    When I try to change the values from the table using the application the operation is never completed.

    If I delete this new trigger then the operations completes with no problem.

    Well there is a logic flaw in there because it does not reference the table being updated.

    Something like this perhaps?

    update contribuintes

    set nif = d.nif,

    filial_number = d.filial_number

    from contribuintes c

    join inserted i on i.nif_antigo = c.nif_antigo

    join deleted d on d.nif_antigo = i.nif_antigo

    where i.numeroposto = 'Central'

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • That updates the entire table!

    I have deleted my first trigger and created a new one based on the code changes you told me.

    The trigger is now like:

    USE [SGCTCentral]

    GO

    /****** Object: Trigger [dbo].[TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF] Script Date: 11/07/2012 15:59:47 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    ALTER trigger [dbo].[TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF]

    on [dbo].[CONTRIBUINTES]

    for update

    as

    update contribuintes

    set nif = d.nif,

    filial_number = d.filial_number

    from contribuintes c

    join inserted i on i.nif_antigo = c.nif_antigo

    join deleted d on d.nif_antigo = i.nif_antigo

    where i.numeroposto = 'Central'

    It updates the entire table ...

  • and please, forget the trigger: TRG_CONTRIBUINTES_TRILHA_ALTERACOES_INS

    I deleted from my table.

  • river1 (11/7/2012)


    That updates the entire table!

    I have deleted my first trigger and created a new one based on the code changes you told me.

    The trigger is now like:

    USE [SGCTCentral]

    GO

    /****** Object: Trigger [dbo].[TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF] Script Date: 11/07/2012 15:59:47 ******/

    SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    ALTER trigger [dbo].[TRG_CONTRIBUINTES_VERIFCA_RF_E_NIF]

    on [dbo].[CONTRIBUINTES]

    for update

    as

    update contribuintes

    set nif = d.nif,

    filial_number = d.filial_number

    from contribuintes c

    join inserted i on i.nif_antigo = c.nif_antigo

    join deleted d on d.nif_antigo = i.nif_antigo

    where i.numeroposto = 'Central'

    It updates the entire table ...

    How does that update the entire table? It will only updates rows where there is a match on the base table, inserted and deleted.

    I can't test the code because there still is no sample data.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • How can I send the data sample?

    Text file?

  • river1 (11/7/2012)


    How can I send the data sample?

    Text file?

    Insert statements.

    Take a look at the first link in my signature about best practices when posting questions.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0016050002', 'A', Null, 'TP7', Null, Null, Null, '3ª CONSERVATORIA DO REG.CIVIL DA COMARCA DE LUANDA', 'MAIANGA', Null, Null, '', '', '01', '', '4.01', '', Apr 26 2004 12:00AM, Nov 6 2012 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, 'S4.01-692161', 'A', Null, 'TP7', Null, Null, Null, '3ª.SECCAO DA SALA DE FAMILIA -TRIBUNAL PROV.LUANDA', 'RUA AMILCAR CABRAL, Nº.29- 5º.ANDAR', Null, Null, '912453984', '', '11', '', '4.01', '040101', Oct 3 2008 12:00AM, Nov 6 2012 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '85019998', 'I', Null, 'TP1', Null, Null, Null, 'MARIO JOSE LISBOA', 'RUA 12 CASA Nº27', Null, Null, '', '', '04', '', '4.01', '', Jan 3 2007 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267547', 'I', Null, 'TP1', Null, Null, Null, 'ANA CASSINDA', 'B' BOA VISTA CASA S/N'', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267553', 'I', Null, 'TP1', Null, Null, Null, 'ABILIO PUPANASSI', 'B' HOSPITAL CASA S/N'', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267560', 'I', Null, 'TP1', Null, Null, Null, 'ENOC ZEFERINO', 'B' NOVA PELE CASA S/N'', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267576', 'I', Null, 'TP1', Null, Null, Null, 'CONSTANCIA CHAPANGA', 'B' KATAPI CASA S/N' ZONA E', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267582', 'I', Null, 'TP1', Null, Null, Null, 'MARIANA ANGELICA NACALANDULA', 'B' CALUEIO CASA N'194', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267599', 'I', Null, 'TP1', Null, Null, Null, 'MARIA ANTONIA NAMATELE', 'AV' DA REPUBLICA CASA N'45', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84267607', 'I', Null, 'TP1', Null, Null, Null, 'EVALINA FEBE SASSAMBA', 'B' KATAPI CASA S/N' ZONA B1', Null, Null, '', '', '', '', '4.01', '', Oct 18 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '10407702', 'I', Null, 'TP1', Null, Null, Null, 'ELISA VUNGE', 'BAIRRO PANGUILA-CACUACO', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279579', 'I', Null, 'TP1', Null, Null, Null, 'NINITA GARCIA RALHA', 'BAIRRO CAOP-CASAS NOVAS', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279585', 'I', Null, 'TP1', Null, Null, Null, 'EVARISTO SAPIO SEGUNDA', 'BAIRRO DO KIKOLO', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '10305574', 'I', Null, 'TP1', Null, Null, Null, 'ENGRACIA SEBASTIAO CAETANO DA SILVA', 'BAIRRO ECOCAMPO,CASA Nº77A', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279616', 'I', Null, 'TP1', Null, Null, Null, 'FRANCISCO SALVADOR JUNIOR', 'BºNGOLA KILUANJE,CASA Nº5-BV,Nº162,Z.16', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279600', 'I', Null, 'TP1', Null, Null, Null, 'ALZIRA CHOCONUMBI NEHEMA VENTURA', 'BAIRRO DO KIKOLO', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279622', 'I', Null, 'TP1', Null, Null, Null, 'TERESA DOMINGOS', 'BAIRRO NDALA MULEMBA', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279639', 'I', Null, 'TP1', Null, Null, Null, 'MERARI RODRIGUEZ CAPOBRES', 'Bº MACULUSSO, Rº KWAMME NKRUMAH, APTºB', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '10312930', 'I', Null, 'TP1', Null, Null, Null, 'ANTUNES ALBERTO', 'BAIRRO DA CALEMBA-MAIANGA', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279645', 'I', Null, 'TP1', Null, Null, Null, 'EUSEBIO IVO', 'BAIRRO KICOLO-CACUACO', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84279651', 'I', Null, 'TP1', Null, Null, Null, 'SABALO LUIS MIRANDA', 'BAIRRO DO KIKOLO', Null, Null, '', '', '04', '', '4.01', '', Dec 7 2005 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84698129', 'I', Null, 'TP1', Null, Null, Null, 'TAVARES BERNARDO ANTONIO', 'BAIRRO DA CAOP PREDIO', Null, Null, '', '', '04', '', '4.01', '', Nov 2 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84698141', 'I', Null, 'TP1', Null, Null, Null, 'HILDEBRANDE DE MELO ARAUJO', 'BAIRRO DA TECNOCARRO', Null, Null, '', '', '04', '', '4.01', '', Nov 2 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '84698135', 'I', Null, 'TP1', Null, Null, Null, 'ZEFERINO MARCIAL', 'BAIRRO KICOLO', Null, Null, '', '', '04', '', '4.01', '', Nov 2 2006 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112811000', 'i', Null, 'TP5', Null, Null, Null, 'MARIA JOAO DE OLIVEIRA', 'BAIRRO KASSEQUEL,ZONA 9,RUA 54,N.20', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112812007', 'i', Null, 'TP5', Null, Null, Null, 'LUZIA JOAO DOMINGOS', 'BAIRRO KASSEQUEL,ZONA 9,RUA 47,CASA N.24', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112815006', 'i', Null, 'TP5', Null, Null, Null, 'JOAO SIMAO MUHONGO', 'BAIRRO CAZENGA ZONA 18 CASA N.16', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112816002', 'i', Null, 'TP5', Null, Null, Null, 'MANUEL FRANCISCO JOAO LOURENCO', 'BAIRRO NEVES BENDINHA CASA N.27', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112818005', 'i', Null, 'TP5', Null, Null, Null, 'JOSEFA DOMINGOS', 'BAIRRO CALEMBA CASA N.1-CA-73', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112819001', 'i', Null, 'TP5', Null, Null, Null, 'FELISBINA M. ESPIRITO SANTO PEREIRA', 'BAIRRO N. BENDINHA,CASA N.35,R. VIOLETA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112822002', 'i', Null, 'TP5', Null, Null, Null, 'MADALENA JOAO', 'B.MACULUSSO RUA G.CARMONA Nº57', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112824005', 'i', Null, 'TP5', Null, Null, Null, 'MANUEL KIALA', 'BAIRRO N. BENDINHA ZONA 12 R.ODP N. 11', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112831001', 'i', Null, 'TP5', Null, Null, Null, 'SEBASTIAO NANI KUNZAILAO', 'B.KILAMBA KIAXI CASA S/N R.NGOLA MBANDI', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112842003', 'i', Null, 'TP5', Null, Null, Null, 'VICTORIA INACIO TEIXEIRA ALVES BEBIANO', 'RUA FERREIRA DE AMARAL Nº167 1ºANDAR', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112845002', 'i', Null, 'TP5', Null, Null, Null, 'SABINO CRISTOVAO', 'BAIRRO CAZENGA,ZONA 18,7.AV. CASA 85', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0112846009', 'i', Null, 'TP5', Null, Null, Null, 'JOAO ANTONIO FRAGOSO', 'BAIRRO KILAMBA KIAXI,ZONA 20,CASA 55', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715760', 'I', Null, 'TP1', Null, Null, Null, 'LULEMBA SOFIA', 'BAIRRO KIKOLO CASA 119 RUA 119', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715813', 'I', Null, 'TP1', Null, Null, Null, 'JOANA PEREIRA DA SILVA JOAO', 'RUA CIRILIO DA CONCEICAO Nº 25', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715820', 'I', Null, 'TP1', Null, Null, Null, 'MARIA JOAO CARDEAU CARNEIRO LOPES ALVES', 'BAIRRO MAIANGA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715842', 'I', Null, 'TP1', Null, Null, Null, 'LUIS DOMINGOS VALENTE', 'Bº NELITO SOARES Z/14', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715871', 'I', Null, 'TP2', Null, Null, Null, 'JOSE JOAO MANGUEIRA VAN-DUNEM', 'RUA RAINHA GINGA Nº 9 5º ANDAR', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04715894', 'I', Null, 'TP1', Null, Null, Null, 'ISIDRO MIGUEL JOAO', 'BAIRRO RANGEL CASA Nº 20', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04717858', 'I', Null, 'TP1', Null, Null, Null, 'ROSA GARCIA JOAO', 'BºMIRAMAR 12 ZONA 10', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718220', 'I', Null, 'TP1', Null, Null, Null, 'JOSE MANUEL DOS SANTOS MENDONCA GAMBOA', 'RUA MISES CAMILO 180-4º 42', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718237', 'I', Null, 'TP1', Null, Null, Null, 'DOMINGOS DOS SANTOS MARIA FERNANDES', 'INGOMBOTA RUA SEVEIRA PEREIRA N' 5 5.39', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718272', 'I', Null, 'TP1', Null, Null, Null, 'EDUARDO DA SILVA RIBEIRO', 'RUA FREDERICO WELWICHIA 11 B', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718540', 'I', Null, 'TP1', Null, Null, Null, 'RAIMUNDO ANDRE MANUEL', 'B'NELITO SOARES Z.11 RUA CZ CASA N.17', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718579', 'I', Null, 'TP1', Null, Null, Null, 'CANDIDO FORBS', 'BºSAMBIZANGA 5 BV-7', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718600', 'I', Null, 'TP1', Null, Null, Null, 'MPANZU FRANCOIS', 'Bº N.BENDINHA ZONA 12', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718881', 'I', Null, 'TP1', Null, Null, Null, 'MARIA EDUARDO', 'BAIRRO PATRICE LUMUMBA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718898', 'I', Null, 'TP1', Null, Null, Null, 'BARTOLOMEU JOAO DOS SANTOS', 'BAIRRO CAZENGA ZONA 18 SECTOR 14', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04718964', 'I', Null, 'TP1', Null, Null, Null, 'JOSE MANUEL DEMBO', 'B' SAMBIZANGA 1/MO/363', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '04719018', 'I', Null, 'TP1', Null, Null, Null, 'SACKHO BOUBACAR', 'Bº HOJI-YA-HENDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375632', 'I', Null, 'TP1', Null, Null, Null, 'PEDRO DA COSTA BOANA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375655', 'I', Null, 'TP1', Null, Null, Null, 'NELSON DIOGO FRANCISCO DE OLIVEIRA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375661', 'I', Null, 'TP1', Null, Null, Null, 'LINO JOAO DA COSTA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375678', 'I', Null, 'TP1', Null, Null, Null, 'ANTONIO MIGUEL FASTUDO FERREIRA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375690', 'I', Null, 'TP1', Null, Null, Null, 'MANUEL GASPAR ANTONIO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375709', 'I', Null, 'TP1', Null, Null, Null, 'PAULO MANUEL NUNES SEBASTIAO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375738', 'I', Null, 'TP1', Null, Null, Null, 'CRISTINA NZAMBI', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02375879', 'I', Null, 'TP1', Null, Null, Null, 'CLAUDIO ANTONIO LIMA ARTUR', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02376100', 'I', Null, 'TP1', Null, Null, Null, 'DOMBELE SILVA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377186', 'I', Null, 'TP1', Null, Null, Null, 'CRISTINA EMILIA SIMAO MANUEL', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377217', 'I', Null, 'TP1', Null, Null, Null, 'RODRIGO DA COSTA BATALHA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377223', 'I', Null, 'TP1', Null, Null, Null, 'JOSE JOAO FAZ CONTA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Jun 11 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377230', 'I', Null, 'TP1', Null, Null, Null, 'JOSE FRANCISCO DA SILVA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377252', 'I', Null, 'TP1', Null, Null, Null, 'SEBASTIAO BENTO PEDRO DA COSTA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377298', 'I', Null, 'TP1', Null, Null, Null, 'TALAMI GARCIA MIEZI', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377306', 'I', Null, 'TP1', Null, Null, Null, 'MIGUEL MAQUIESE QUINANGA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377312', 'I', Null, 'TP1', Null, Null, Null, 'MULANGUI FRANCO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377329', 'I', Null, 'TP1', Null, Null, Null, 'FERNANDO MIGUEL VAZ', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377370', 'I', Null, 'TP1', Null, Null, Null, 'MARIA CAROLINA GUERREIRO DA S.SALAVISA', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '02377387', 'I', Null, 'TP1', Null, Null, Null, 'ALEXANDRE ALBERTO EDUARDO JOAQUIM', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01405940', 'i', Null, 'TP1', Null, Null, Null, 'CATARINA VALE MELO', 'RUA HOJY YA HENDA N:144', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01405957', 'i', Null, 'TP1', Null, Null, Null, 'JOAQUIM DE OLIVEIRA DOS SANTOS CEA', 'BAIRRO OPERARIO,RUA C N:67', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01396796', 'I', Null, 'TP1', Null, Null, Null, 'VICENTE NOE ANTONIO SEBASTIAO', 'B. NGOLA KILUANGE', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01396810', 'I', Null, 'TP1', Null, Null, Null, 'FRANCISCO JOAO CRISTOVAO NETO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01396827', 'I', Null, 'TP1', Null, Null, Null, 'KINKADI JOAO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '01399932', 'I', Null, 'TP1', Null, Null, Null, 'ALEXANDRE MANUEL NETO', 'LUANDA', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054589002', 'i', Null, 'TP5', Null, Null, Null, 'VIS-A-VIS-COMER.GERAL AGRO-PECUARIA, LDA', 'Bº PALANCA ZONA 12', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054592003', 'i', Null, 'TP5', Null, Null, Null, 'DIENGA NSANGU LUIS', 'BºNEVES BENDINHA C.REGRESSADOS', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054593000', 'i', Null, 'TP5', Null, Null, Null, 'JOAO PEREIRA MASSAMO', 'BºPATRICE LUMUMBA R.TIMOR 40', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054594006', 'i', Null, 'TP5', Null, Null, Null, 'KUHENHA-SOCIEDADE DE COMERCIO GERAL, LDA', 'BºNEVES BENDINHA RUA DA GABELA Nº125', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '00546006', 'I', Null, 'TP1', Null, Null, Null, 'KIAMBI GRACA', 'BºNGOLA KILUANGE', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054627001', 'i', Null, 'TP5', Null, Null, Null, 'PEDRO JACINTO GUMBA', 'BAIRRO MARCAL', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054628008', 'i', Null, 'TP5', Null, Null, Null, 'VICTOR DA FONSECA FRANCISCO', 'BºP.LUMUMBA-PRAC.REI KATYAVALA R/C 1º 11', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054629004', 'i', Null, 'TP5', Null, Null, Null, 'ESTEVES ANTONIO', 'BAIRRO CAZENGA ZONA 18 CASA Nº 30', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054630002', 'i', Null, 'TP5', Null, Null, Null, 'AFONSO PEREIRA', 'BAIRRO HOJI YA HENDA Nº 15', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054631009', 'i', Null, 'TP5', Null, Null, Null, 'ARMANDO GONGO CASSANGE', 'KILAMBA KIAXI Nº 15-A', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054632005', 'i', Null, 'TP5', Null, Null, Null, 'PROMOCOES SEBRIN, LDA', 'AVªCDTE HOJI YA HENDA Nº 100 3ºE', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054634008', 'i', Null, 'TP5', Null, Null, Null, 'ADRIANO DOMINGOS DA SILVA', 'Bº KILAMBA KIAXI Nº 286', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054635004', 'i', Null, 'TP5', Null, Null, Null, 'RITA DO ROSARIO FERREIRA PEREIRA-RINEL', 'RUA LOPES DE LIMA Nº30', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054636000', 'i', Null, 'TP5', Null, Null, Null, 'CORDEIRO ERNESTO NZAKUNDOMBA', 'BºKILAMBA KIAXI Z.20 SUBZ.15 CASA Nº45', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054637007', 'i', Null, 'TP5', Null, Null, Null, 'VENTURA DOMINGOS FRANCISCO', 'Bº KASSEQUEL ZONA 9 CASA Nº 18', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054639000', 'i', Null, 'TP5', Null, Null, Null, 'PAULO JAIME SERGIO CAPELO', 'BAIRRO NELITO SOARES RUA DOURO Nº111/A', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054640008', 'i', Null, 'TP5', Null, Null, Null, 'ANDRE FRANCISCO', 'Bº GOLF MUNICIPIO KILAMBA KIAXI', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054641004', 'i', Null, 'TP5', Null, Null, Null, 'EXPROPEC-EXPLOR.AGRO-PECUARIA COM., LDA', 'Bº VALODIA PREDIO PREDIO 294 1º 11', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054642000', 'i', Null, 'TP5', Null, Null, Null, 'SOKWANZA-SOC.COM.PROD.QUIM.FARMAC., LDA', 'RUA HIGINO AIRES Nº 22 B', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '0054643007', 'i', Null, 'TP5', Null, Null, Null, 'MAVILDE DE FATIMA BESSA TEIXEIRA', 'VILA ALICE RUA EUGENIO DE CASTRO 45', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

    INSERT INTO CONTRIBUINTES VALUES ('7401010488',Null, '03347537', 'I', Null, 'TP1', Null, Null, Null, 'DARIO ROBERTO MACHADO E SILVA', 'BºALVALADE', Null, Null, '', '', '04', '', '4.01', '', Apr 26 2004 12:00AM, Jan 1 1900 12:00AM, Jan 1 1900 12:00AM, Null, Null, Null, Null, Null, Null, Null, null, 'CENTRAL', null, ''

Viewing 15 posts - 16 through 30 (of 39 total)

You must be logged in to reply to this topic. Login to reply