What is the difference between := and Into in the select query ?
eg:
SELECT filesinfo.IsFolder,
filesinfo.ReferenceID
INTO @IsFolder, @ReferenceID
FROM filesinfo
WHERE filesinfo.FileID = @ChildID;
and:
SELECT @IsFolder := filesinfo.IsFolder,
@ReferenceID := filesinfo.ReferenceID
FROM filesinfo
WHERE filesinfo.FileID = @ChildID;
You can use the
INTOclause to write the output to a file as well as store in a variable.While, the assignment operator
:=only assigns a scalar value to a variable.