J'ai un sproc (MSSQL 2k5) qui prendra une variable pour une claus comme comme si:Utiliser la variable dans l'instruction SQL LIKE
DECLARE @SearchLetter2 char(1)
SET @SearchLetter = 't'
SET @SearchLetter2 = @SearchLetter + '%'
SELECT *
FROM BrandNames
WHERE [Name] LIKE @SearchLetter2 and IsVisible = 1
--WHERE [Name] LIKE 't%' and IsVisible = 1
ORDER BY [Name]
Malheureusement, la ligne en cours d'exécution génère une erreur de syntaxe, alors que la clause where commentée fonctionne très bien. Quelqu'un peut-il me aider à obtenir la ligne non commenté travail?
Merci. Ça a marché pour moi – Goldfish