Originally posted by Mulligan
You're inserting data that is larger than the maximum page size for SQL Server. See this page.
Thanks for the link. I had already taken a look there before finding this forum but I couldn't understand why my data was longer than the page size for SQL because I was only inserting a small amount of data.
I found that my problem due to MS SQL creating a temporary table based on my Insert Statement using the table definition for the size of the columns. In this case, I had a nvarchar(4000) column. This then generated a temp table with a column size equivalent to 8363 bytes but the page size is 8060. This happens even though the data I was inserting was much smaller than the max length.
To resolve the problem I had to reduce to the column size to a maximum of 3868. This resolved the problem.