Wednesday, 8 February 2017

MSSQL - Fix Error - Must declare the scalar variable


Watch on YouTube


To fix it replace
Select Replace(LastName, @ReplaceText, 'ggggggg') as p from Customers

with
Declare @ReplaceText varchar(1) = 'a'
Select Replace(LastName, @ReplaceText, 'ggggggg') as p from Customers

No comments:

Post a Comment