String data, right truncation error
asp-classic, sql-server
Solution
Try creating the parameter like this instead:
addCMD.Parameters.Append(addCMD.CreateParameter("emailbody", adLongVarchar, adParamInput, Len(emailbody), emailbody))
Problem
I'm calling a stored procedure that inserts html data into a varchar(max) field via ASP, the original html is about 56kb in size. The parameter for the proc is also varchar(max). All the research I've done references buffer size. Any ideas on how to work around this? I use a hosting service so SQL configuration changes could be tricky. The error I'm getting is "String data, right truncation". Here is the asp code calling the stored procedure. ``` Dim addRS, addCMD Set addCMD = Server.CreateObject("ADODB.Command") addCMD.ActiveConnection = objconn addCMD.CommandType = adCmdStoredProc addCMD.CommandText = "insert_emailjob" addCMD.Parameters.Append(addCMD.CreateParameter("emailbody",adVarchar,adParamInput,10000000,emailbody)) set addRS = server.createobject("ADODB.Recordset") addRS.CursorLocation = adUseClient addRS.open addCMD ```