A large Excel spreadsheet has to be copied into the SQL Server database. I am reading all of the data from the [Sheet1$] by opening an OldDbConnection to the Excel spreadsheet. I then obtain an IDataReader with the spreadsheet data using the OleDbCommand.
The Excel document has a number of cells with text that is longer than 256 characters. However, when I use SqlBulkCopy to transfer this to the database table, I only see the first 255 characters from these excel columns. The fields in the database table may hold 5000 characters.
Does SqlBulkCopy have a field size restriction? Thanks!
SqlBulkCopy and OldDbConnection are unfamiliar to me.
Excel may only be providing the first 255 characters, however.
When accessing a cell's value in Excel, the first 255 characters are returned if you use the.value property, and the whole text is returned if you use the.text property. I hope this helps you with your thinking.