To protect against sql injection, I read in the introduction to ColdFusion that we should use the cfqueryparam tag.
But when using stored procedures, I pass my variables to the corresponding variable declarations in SQL Server:
DROP PROC Usr.[Save]
GO
CREATE PROC Usr.[Save]
(@UsrID Int
,@UsrName varchar(max)
) AS
UPDATE Usr
SET UsrName = @UsrName
WHERE UsrID=@UsrID
exec Usr.[get] @UsrID
Q: Is there any value in enabling cfSqlType when calling a stored procedure? Here's how I do it now in Lucee:
storedproc procedure='Usr.[Save]' {
procparam value=Val(form.UsrID);
procparam value=form.UsrName;
procresult name='Usr';
}
source
share