Alter Tickets.Note from nvarchar(max) to nvarchar(xxx)

I use ticket notes for table names. I’ve experienced some slow downs when a lot of tables (tabs) are in use when switching back to the tables screen after payments, and such. The query to find the Note seems to be the choke-point.

I went to add an index on the ‘Note’ column. I can’t because the datatype is nvarchar(max).

Since we’ll never need to use the max char limit, would it be safe to alter the column to a lower limit, thus allowing me to add an index? Not seeing the code that runs in SambaPOS, I don’t know if this will cause problems.

TIA

That won’t help. The issue with using those tags in that screen is it’s querying every one of them every time you view that screen. So if you get many tables it will be slower and slower. Everytime it updates it queries all of them. So you need to be cautious with what you put on that screen.

Thank you for your reply.

I fully understand that it hits the db every time.

I want to run some tests on a dev copy. Before I do, I don’t know if it’ll break anything with EF in the app.