set xact_abort on;
go

begin transaction;
go

set ANSI_NULLS on;
go

/*************************************
* STORED PROCEDURE stp_userLoginRefreshDb
*
*  alla login utente effettua alcune utility bach di refresh db
*
* mod : 2013.01.14	
* aut : S.E. Locatelli
**************************************/
alter PROCEDURE stp_userLoginRefreshDb

AS

--=============================================================================
-- Setup
--=============================================================================
DECLARE @StartTime DATETIME    --Timer to measure total duration
    SET @StartTime = GETDATE() --Start the timer

--=============================================================================
-- Chiama stored x refresh di alcune viste "problematiche" x linkedservers
--=============================================================================
EXEC sp_refreshview 'v_selFonti'



--===== Display the total duration
SELECT STR(DATEDIFF(ms,@StartTime,GETDATE())) + ' Milliseconds duration' as msecExec


RETURN
go

commit;
go


set xact_abort on;
go

begin transaction;
go

set ANSI_NULLS on;
go

/*************************************
* STORED PROCEDURE stp_tbDocs_getByNrProto
*
*  recupera documenti data chiave
*
* mod : 2012.10.09	
* aut : S.E. Locatelli
**************************************/
create PROCEDURE stp_tbDocs_getByNrProto
(
    @Numero	INT = 0,
    @Anno	INT = 0
)

AS

    SELECT	*
    FROM	tbDocumenti
    WHERE	Numero  = @Numero
        AND	Anno    = @Anno

RETURN
go

commit;
go






-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(135, GETDATE())
GO
SELECT TOP 10 * FROM LogUpdateDb ORDER BY Versione DESC
GO
