I have the following stored procedure
CREATE PROCEDURE SigleEnseigne
@Sigle VARCHAR OUTPUT,
@Enseigne VARCHAR OUTPUT,
@SigleEnseigne1 VARCHAR(150) OUTPUT
AS
BEGIN
SELECT ISNULL(John_Jack.Sigle,'')
INTO Sigle
FROM John_Jack
SELECT ISNULL(John_Jack.Enseigne,'')
INTO Enseigne
FROM John_Jack
SELECT
CASE
WHEN Code_Juridique LIKE 'M%' THEN ' / ' + @Enseigne INTO @SigleEnseigne1
WHEN @Sigle = '' AND @Enseigne = '' THEN '' INTO @SigleEnseigne1
ELSE @Sigle + ' / ' + @Enseigne INTO @SigleEnseigne1
END
FROM John_Jack
END
GO
I've got this error code when creating the sp
Msg 156, Niveau 15, État 1, Procédure SigleEnseigne, Ligne 29
Syntaxe incorrecte vers le mot clé 'INTO'.
SQL Server doesn't like this line
WHEN Code_Juridique LIKE 'M%' THEN ' / ' + @Enseigne INTO @SigleEnseigne1
Can anyone give me some insight of what I'm doing wrong, please? I'm fairly new to SQL Server, my script may not respect the T-SQL standard. If so, please enlighten me.
Thanks
Sigle,EnseigneandSigleEnseigne1, to be able to retrieve them when I'll use the sp in my reports