0

I have a predefined SQL data base that we have to work correctly with a reporting software we have purchased. When ever we pull a column of data with the reporting software we get system.indexoutofrangeexception error. On the first table we replaced all Semi Colons ';' with space within the data and this corrected the issue. This column does not have any other special characters within the data only semi colons.

However the data in the second column we need to query contains all different kinds of characters that are probably invalid. The column type is ntext and would like to either change the data directly in the sql database everytime there is a new entry or would changing the format to nvarchar(max) or nvarchar(1024) be suffice?

Thanks for the support I am beyond green at sql.

jarlh
  • 42,561
  • 8
  • 45
  • 63
CAL
  • 1
  • That is not a SQL exception per se. I think you need to contact the company that makes this reporting software, or somehow get your question beyond this software such that this becomes an actual programming or database question. Can you see the actual database statements being run (SQL Server Profiler?) or see the code that this software is running? – Tim Lehner Jul 08 '16 at 14:48
  • I am unable to see the code running within the reporting software however I can examine the data using the SQL server profiler. I have saved the trace files. It appears to continue to 'exec sp_cursor 18015003,40,1'. The last digit in this case 1 increments upto 1055. – CAL Jul 08 '16 at 14:59
  • It will be very difficult for anyone to help you with a black box. I would be very hesitant to change data to suit a reporting tool, especially not knowing which characters are breaking the tool, and _why they do so_. – Tim Lehner Jul 08 '16 at 15:03

1 Answers1

0

Your problem is most likely not related to the datatype in your database but the data itself.

Your reporting software seems to have specific requirements that your data does not meet.

Jonny
  • 1,037
  • 7
  • 15
  • I agree with your comment. the data within the data table is not cooperating with the reporting software. The software generates an sql query to pull the data into excel. As the limitation is the reporting software is there a way within the SQL datatables to remove the invalid characters automatically? The SQL statement is as follows for software SELECT RecordID, DateTimeOccurred, EventSource, Location, Resource, UserName, DateTimeLogged, AttachmentCount, Message FROM [log_AuditEventLog] ORDER BY RecordID ASC – CAL Jul 08 '16 at 14:37