Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select with Like not working with parameter
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01537428
Message ID:
01537632
Views:
39
>Hi Naomi,
>Thes Char fields that were causing the problem were all Char(10) and are set up really as lookup codes (e.g. Rep Numbers, Account numbers, Area Codes)
>
>I had started off using Varchar for these but ran into some issues on looking up data (Can't remenmber exactly what the issues were) but changed to Char(10) for any of these type fields and it sorted the problem at the time
>
>For any variable length fields I tend top use VarChar , but perhaps I should revisit why I used the Char(10 fields)
>
>Regards,
>Gerard
>
>
10 chars is not too much of a problem. We use 10 chars ourselves for 3 compound keys (department, category, item) in many tables. I believe it's a problem of converting old VFP apps into SQL Server backend and it was never addressed.

So, for existing keys you may keep char(10), but make sure to use correct structures in the future.

BTW, just recently I discovered another suprising fact that nobody noticed before (10 or more years of usage). All varchar fields are linked to char fields by default when using SPT and so we save all our data with trailing spaces and lost all benefits of varchar fields. Hopefully we will be able to address this problem in a future.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform