SBarnes wrote:Is there any reason why the contents field is SO_CustomSettingValues is only 255 varchar and can it be made any bigger, my reason is we may need to store another file format (EDIFACT) against an order to pass to anther system, these orders would come in through the XML import?
The reason for the limit was consistency with other varchar fields in the system storing long descriptions, et cetera.
SQL Server has row size limits - 8060 I think is what SQL 2014 has a limit of - but you can (as of SQL 2005 I think) use VARCHAR(MAX) to utilise row overflow storage automatically. If you want to store documents, in a custom field you should probably instead insert an entry into SY_File - that has an image column which can store up to 2GB files, and then set the SO_CustomSettingValues value to be the SY_File.FileID.
You could *try* altering the SO_CustomSettingValues.Contents column to be VARCHAR(MAX) and see if the software doesn't truncate on insert or update - I can't check right now, unfortunately (a hardware fault took some of our machines offline, including my Version 6 sourcecode VM - I'm still working on getting that back online). I'll check it when I can, but it would be easy to test it out yourself -
- Code: Select all
ALTER TABLE SO_CustomSettingValues ALTER COLUMN Contents VARCHAR(MAX) NULL
And to put it back:
- Code: Select all
ALTER TABLE SO_CustomSettingValues ALTER COLUMN Contents VARCHAR(255) NULL
Of course - as always - don't do this testing on a production database!
Mike