SQL stored procedure works but with errors
问题 I have table with 3 primary keys : CODE_TARIF, UNITE , and MODE_LIV . I write a stored procedure to copy and paste but with different MODE_LIV . ex: if I already have 2 rows in table T_TARIF with MODE_LIV = 2, when I run this stored procedure with input MODE_LIV =3 , I will have 4 rows . ALTER PROCEDURE [dbo].[Copy_Tarif] -- Add the parameters for the stored procedure here @MODE_LIV int AS BEGIN DECLARE @CODE_TARIF varchar(15) DECLARE @ZONE int DECLARE @UNITE int DECLARE @LIBELLE varchar(30)