1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Auteur: Daniel
-- Date création : 21-06-2013
-- Description: Insertion notes éco contribution
-- =============================================
ALTER PROCEDURE NotesEcoContribution
AS
SET LANGUAGE US_ENGLISH
declare @MaxNum int
-- Initialisation de la variable.
SELECT @Maxnum = max(nnoid)+1 from notes;
print @Maxnum
INSERT INTO NOTES ( NNOID, ANOOBJECT, DNODATCR, DNODATDE, ANOAUTEUR, ANOTYPE, ANOTEXT1, ANOLTYP, ANOLID )
SELECT DISTINCT '@Maxnum' AS Expr1, 'Eco contribution Mobilier' AS Expr2, getdate() AS Expr3, getdate() AS Expr4,
'Daniel' AS Expr5, 'Alerte' AS Expr6,
'Le champ Coeff. TP1 de la fiche est égal à 0' AS Expr7, 'AR' AS Expr8, '143718' AS Expr9
FROM NOTES
SET ANSI_NULL_DFLT_ON ON
SET NOCOUNT OFF
BEGIN
SET NOCOUNT ON;
END
GO |
Partager