Forum Replies Created

Viewing 15 posts - 346 through 360 (of 774 total)

  • RE: Stored procedure error

    It returns this error:

    Msg 8114, Level 16, State 5, Procedure spSGCT_UPDATESINCRONISMO_SGCTLOCAIS, Line 32

    Error converting data type varchar to bigint.

  • RE: Stored procedure error

    Hi saw IT.

    Definition:

    CREATE TABLE [dbo].[SINCRONISMO](

    [CODIGO] [bigint] IDENTITY(1,1) NOT NULL,

    [DT_INI_PROC] [datetime] NOT NULL,

    [DT_FIM_PROC] [datetime] NULL,

    [TP_PROCESSO] [char](1) NOT NULL,

    [COD_TP_CLASSIFICACAO] [int] NOT NULL,

    [UTILIZADOR] [int] NOT NULL,

    [COD_SINCRONISMO] [bigint] NULL,

    [FICHEIRO] [varchar](255) NOT NULL,

    [COD_REP_FISCAL] [varchar](5) NULL,

    [COD_SINCRONISMO_INI]...

  • RE: Stored procedure error

    "You have a data mismatch between what your attempting to insert into the table, and what the table expects"

    hum?

    where?

  • RE: Distinct

    WHAT ARE CTE's?

  • RE: Distinct

    maybe you can help me with this too:

    IF I do a select like:

    (SELECT

    [NIF_ANTIGO],

    [NIF],

    [FILIAL_NUMBER],

    [STATUS],

    [COD_GRP_CONTRIBUINTE],

    [COD_TP_SINGULARES],

    [COD_MET_TRIBUTARIO],

    [COD_TP_IMPOSTOS],

    [GRANDE_CONTRIBUINTE],

    [NOME],

    [MORADA],

    [COD_CIDADE],

    [C_POSTAL],

    [TELEFONE],

    [FAX],

    [COD_PROVINCIA],

    [COD_MUNICIPIO],

    [COD_REP_FISCAL],

    [DT_INICIO],

    [DT_ALTERACAO],

    [DT_CESSACAO],

    [COD_MOT_CESSACAO],

    [MOT_CESSACAO],

    [COD_TP_INSTITUICAO],

    [COD_FUNC],

    [COD_COMUNA],

    [COD_BAIRRO],

    [OBS],

    [DT_BEGIN],

    [BI],

    [OLD_NIF],

    [PSERVTCO],

    [PSERVTCP],

    [PSERVA],

    [DTACESSACAOTCO],

    [DTACESSACAOTCP],

    [DTACESSACAOA]

    FROM

    (SELECT

    rn = ROW_NUMBER() OVER(PARTITION BY NIF_ANTIGO ORDER BY Cod_Bairro),

    [NIF_ANTIGO],

    [NIF],

    [FILIAL_NUMBER],

    [STATUS],

    [COD_GRP_CONTRIBUINTE],

    [COD_TP_SINGULARES],

    [COD_MET_TRIBUTARIO],

    [COD_TP_IMPOSTOS],

    [GRANDE_CONTRIBUINTE],

    [NOME],

    [MORADA],

    [COD_CIDADE],

    [C_POSTAL],

    [TELEFONE],

    [FAX],

    [COD_PROVINCIA],

    [COD_MUNICIPIO],

    [COD_REP_FISCAL],

    [DT_INICIO],

    [DT_ALTERACAO],

    [DT_CESSACAO],

    [COD_MOT_CESSACAO],

    [MOT_CESSACAO],

    [COD_TP_INSTITUICAO],

    [COD_FUNC],

    [COD_COMUNA],

    [COD_BAIRRO],

    [OBS],

    [DT_BEGIN],

    [BI],

    [OLD_NIF],

    [PSERVTCO],

    [PSERVTCP],

    [PSERVA],

    [DTACESSACAOTCO],

    [DTACESSACAOTCP],

    [DTACESSACAOA]

    FROM

    BULK_CONTRIBUINTES_21...

  • RE: Distinct

    thank you very very much.

    Excellent solution!

  • RE: Distinct

    It Does not matter what is the value, but it most be a value from the field

  • RE: Distinct

    Because I need a value for the filed.

    For example:

    the cod_bairro can be 1, 2, 3, .....

    I need one of this values.

  • RE: Distinct

    "How do you decide which row to pick"

    The records are like:

    NIF_antigo ; NIF; Olther Fields; Cod_Bairro

    00000001 1 1 ...

  • RE: Distinct

    I have seens that they have only a diferente value. It's the cod_bairro. It the three records only this field has diferente values....

    How can I return a distinct NIF_antigo...

  • RE: Procedure error message

    or this piece of code:

    IF (@MaxTotalidade > @MaxDiferenca)

    BEGIN

    IF (select count(sessaofim) from FicheirosImportar where

    sessaoinicio <> 'T' and sessaofim > @MaxTotalidade and codrf =''+@codrf+'') <> 0...

  • RE: Procedure error message

    It seems like this happens only when the code enters in the condition:

    IF (select count(sessaofim) from FicheirosImportar where

    sessaoinicio ='T' and sessaofim > @MaxTotalidade

    and sessaofim >...

  • RE: Procedure error message

    IF I do it like you told:

    Declare the variable I receive this error:

    The variable name '@MinVal' has already been declared. Variable names must be unique within a query batch or...

  • RE: query performance

    That was the problem.

    I should had B in one of the places instead of having A in both.

    Thank you very much.

    Problem solved.

  • RE: Try Catch

    and inside the proc 1

    proc 2

    ...

Viewing 15 posts - 346 through 360 (of 774 total)