What are the disadvantages of using a varchar (max) MSSQL field? [closed]

1

Currently, I work in the support of a web application where users place orders, the system works great, but there is a section in which we have had difficulties, the blog, when a user registers an order is used var jsonSerialiser = new JavaScriptSerializer(); jsonSerialiser.Serialize(infoPedido); for convert all the information of the order into a string of characters and be able to save it in the log table, the reason that it is designed like this is because the log is used in all product modules, production, delivery, so we do not have a schema Specify which fields to save so it is saved in a string field, in a field that is defined as varchar(600) , the system has about 6 months operating and apparently covered our needs, but it has happened a couple of times the orders are not saved because it thunders when inserting in the blog, this is because on average users upload a maximum of 3 products per order so the number of characters averages 600, but it has happened Since a user already registered 6 products, we increased the number of characters to 1000 and today a user registered 17, the number of characters suddenly skyrocketed. At this point it is clear that the information registered by users is no longer something that we can have controlled by what we consider to use varchar(max) . Most of the articles that I have read the users know more or less how many characters they need to cover, in my case it is too variable (although it is not so common) I have also read that setting the varchar at maximum would allow saving up to a maximum of 2gb in characters, it is obvious that it is superfluous, but what alternatives do I have? If I apply this, will it affect the performance of inserts?

Also mention that this table is never consulted, unless it finds a problem with a client or suspects that someone violates the codes of conduct of the company.

I hope someone can answer my question, greetings and thanks!

    
asked by Jesús Miraanda 19.10.2018 в 18:37
source

0 answers