CREATE PROCEDURE AjouterLSTArticle
 @ID int OUTPUT,
 @PanierID int,
 @ArticleID int,
 @Quantite int,
 @PrixHTVA money,
 @TVA int
AS
 INSERT INTO LSTArticle(PanierID,ArticleID,Quantite,PrixHTVA,TVA)
  VALUES(@PanierID,@ArticleID,@Quantite,@PrixHTVA,@TVA)
 SET @ID=@@IDENTITY
RETURN
GO
CREATE PROCEDURE ModifierLSTArticle
 @ID int,
 @PanierID int,
 @ArticleID int,
 @Quantite int,
 @PrixHTVA money,
 @TVA int
AS
 IF(@ID IS NULL OR @ID=0)
  RAISERROR('Identifiant requis !',16,1)
 ELSE  UPDATE LSTArticle
        SET PanierID=@PanierID,ArticleID=@ArticleID,Quantite=@Quantite,PrixHTVA=@PrixHTVA,TVA=@TVA
        WHERE ID=@ID
RETURN
GO
CREATE PROCEDURE SelectionnerLSTArticle
 @Index VARCHAR(10)
AS
 IF(@Index='PanierID') SELECT * FROM LSTArticle ORDER BY PanierID
 ELSE IF(@Index='ArticleID') SELECT * FROM LSTArticle ORDER BY ArticleID
 ELSE IF(@Index='Quantite') SELECT * FROM LSTArticle ORDER BY Quantite
 ELSE IF(@Index='PrixHTVA') SELECT * FROM LSTArticle ORDER BY PrixHTVA
 ELSE IF(@Index='TVA') SELECT * FROM LSTArticle ORDER BY TVA
 ELSE SELECT * FROM LSTArticle ORDER BY ID
RETURN
GO
CREATE PROCEDURE SelectionnerLSTArticle_ID
 @ID int
AS
 IF(@ID IS NULL)
  RAISERROR('Identifiant requis !',16,1)
 ELSE
  SELECT ID,PanierID,ArticleID,Quantite,PrixHTVA,TVA
  FROM LSTArticle
  WHERE @ID=ID
RETURN
GO
CREATE PROCEDURE SupprimerLSTArticle
 @ID int
AS
 IF(@ID IS NULL)
  RAISERROR('Identifiant requis !',16,1)
 ELSE
  DELETE FROM LSTArticle WHERE @ID=ID
RETURN
GO
