I am posting data from a table to excel using openrowset however i keep getting 'String or binary data would be truncated.' errors which i assume means the data i am passing is too big. My code is below:
DECLARE @SQL3 as varchar(max)
SET @SQL3=N'INSERT INTO OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;HDR=YES;DATABASE='+@xlFileName3+''',''Select * from [DATA$]'')SELECT REF,CASETYPE,NAME1,NAME2,NAME3,ADDRESS1,ADDRESS2,ADDRESS3,CITY,COUNTY,POSTCODE,el_notes FROM V_EL'
EXEC(@SQL3)
i have declared everyting in the rest of my code - i was thinking the el_notes field which contains case notes is is too many words. Is there anything to change the varchar(max) or is the problem with excel.
this code works fine when the el_notes field contains less text.
DECLARE @SQL3 as varchar(max)
SET @SQL3=N'INSERT INTO OPENROWSET(''Microsoft.Jet.OLEDB.4.0'',''Excel 8.0;HDR=YES;DATABASE='+@xlFileName3+''',''Select * from [DATA$]'')SELECT REF,CASETYPE,NAME1,NAME2,NAME3,ADDRESS1,ADDRESS2,ADDRESS3,CITY,COUNTY,POSTCODE,el_notes FROM V_EL'
EXEC(@SQL3)
i have declared everyting in the rest of my code - i was thinking the el_notes field which contains case notes is is too many words. Is there anything to change the varchar(max) or is the problem with excel.
this code works fine when the el_notes field contains less text.