I'm doing conversion of Error Code thrown by SSIS package using SQL 2008 into meaningfull description provided by SSIS. All Error Codes and their Descriptions can be found here as reference.

My question is does anyone know what is maximum length of Error Code description which could appear here? I want to store this error description in table and don't want to do it by setting data type to varchar(max) (insufficient approach).

Thanks in advance

有帮助吗?

解决方案

It looks to be 423 characters based on the last time I pulled those codes for my post

;WITH ERRORS ([Hexadecimal code],[Decimal Code],[Symbolic Name],[Description]) AS
(
    SELECT '0x8002F347',-2147290297,'DTS_E_STOREDPROCSTASK_OVERWRITINGSPATDESTINATION','Overwriting Stored Procedure "__" at destination.'
)
SELECT
    MAX(LEN(E.DESCRIPTION)) AS DescriptionLength
FROM
    ERRORS E;

I'd just round up to 450/500/512 for your purposes

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top