I've got code in ASP that puts values into a Text field in SQL Server using parameterized queries. I was wondering if parameterizing is enough, or if I have to search the field for potential commands, replacing single ticks with double ticks,etc. The text fields are essays, so they might have any number of words or characters.
Am I safe?
sSQL="[usp_SaveDocumentGradeCriteria]"
Set dbCommand = Server.CreateObject("ADODB.Command")
Set dbCommand.ActiveConnection = oConn
dbCommand.CommandType = adCmdStoredProc
dbCommand.Commandtext=sSQL
dbCommand.Parameters.Append (dbCommand.CreateParameter("@CriteriaXML", adLongVarChar, adParamInput, len(saveXML), saveXML))
dbCommand.Parameters.Append (dbCommand.CreateParameter("@Comments", adLongVarChar, adParamInput, len(commentText), commentText))
dbCommand.Parameters.Append (dbCommand.CreateParameter("@documentGUID", adGuid, adParamInput, 0, documentGUID))
dbCommand.Parameters.Append (dbCommand.CreateParameter("@graderFYCUserID", adInteger, adParamInput, 0, fycuserid))
dbCommand.Parameters.Append (dbCommand.CreateParameter("@graderSequence", adInteger, adParamInput, 0, graderSequence))
if trim(grade)<>"" then
dbCommand.Parameters.Append (dbCommand.CreateParameter("@grade", adInteger, adParamInput, 0, grade))
end if
set oRST=dbCommand.Execute