• Raymond,

    the problem is that there are invalid charaters in the string to convert. Just replace the following code :

    SELECT drive,

    ltrim(rtrim(left(info,29))) as InfoType,

    ltrim(rtrim(substring (info, charindex (':',info) + 2, 20))) as Size_Bytes

    INTO #tmpFSutilDriveSpaceInfo_Fixed

    FROM #tmpFSutilDriveSpaceInfo

    with this one :

    SELECT drive,

    ltrim(rtrim(left(info,29))) as InfoType,

    replace(replace(replace(substring (info, charindex (':',info) + 2, 20),' ',''),char(13),''),char(10),'') as Size_Bytes

    INTO #tmpFSutilDriveSpaceInfo_Fixed

    FROM #tmpFSutilDriveSpaceInfo

    and everything should works fine.