Welcome to Sign in | Help

eroare procedura stocata !!

  •  05-12-2008, 11:28 PM

    eroare procedura stocata !!

    salut ,

    am urmatoarea procedura stocata:

    create procedure [dbo].[uspGivePosRights](

    @idop [smallint],

    @idpos [int],

    @tip [int])

    AS

    BEGIN

    declare @idUser smallint;

    create table #rightsUp(idtipUp int)

    create table #rightsDown(idtipDown int)

    insert #rightsUp exec getTipUpNodes @tip

    insert #rightsDown exec getTipDownNodes @tip

    SELECT 1

    from [ZIM].[dbo].[TBLOP_POS_EMP_ASSOC]

    where [ID_OP] = @idop

    and isnull([ID_POS],-1) = @idpos

    and [id_tip] in (select idtipUp from #rightsUp)

    BEGIN TRY

    --inactivam drepturile date pozitie pe nivele inferioare spre a activa nivelul superior

    UPDATE [TBLOP_POS_EMP_ASSOC]

    SET END_DATE = GETDATE()

    WHERE ID_OP = @IDOP AND END_DATE IS NULL

    AND ID_TIP IN (SELECT idtipDown from #rightsDown and idtipDown <> @tip)

    INSERT INTO TBLOP_POS_EMP_ASSOC (ID_OP, ID_POS,ID_TIP, START_DATE)

    VALUES(@IDOP, @IDPOS, @TIP, GETDATE());

    RETURN 1;

    END TRY

    BEGIN CATCH

    EXECUTE [dbo].[uspLogError]

    RETURN -1;

    END CATCH;

    --END

    END

    GO

     

    la compilare da urmatoarea eroare "

    Msg 156, Level 15, State 1, Procedure uspGivePosRights, Line 29

    Incorrect syntax near the keyword 'and'."

    linia la care da eroarea fiind cea pe fond galben, si chiar nu inteelg de ce...

    Multumesc anticipat pt un raspuns

View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems