Skip to main content
While developing a system using three K2 processes, I came across a problem exporting one of the processes. The process would compile, but when it was exported, it failed with an error "A database error occured".

I ran a database trace to try and see what was happening. The trace showed a call to a stored procedure called "sExportProcSet". I copied this statement from the profiler and into Query Analyzer and ran it against the K2 database - it returned the following error:
Server: Msg 8152, Level 16, State 6, Procedure sExportProcSet, Line 11
String or binary data would be truncated.
The statement has been terminated.
The 'sExportProcSet' procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.

I looked at the code for the sExportProcSet stored procedure in the K2 database. The procedure takes several variables as parameters, all declared as NVARCHAR. The Descr parameter was declared with a size of 256. Looking at the length of my process description - 171 characters. This is where the problem occurred - the maximum length of the description is 256 / size of NVARCHAR = 128. I verified this by shortening my description to 128 characters and the process exported successfully. Adding a single extra character caused the export to fail.

So, the field lengths for a process are half what is expected!

Regards

Mike

Also, the error message has a spelling mistage: it should be "A database error has occurred".
Thanks for the heads-up Mike!

Reply