Text value exceeds text field length

KeithMMoore
Member Posts: 59
I have a new client preparing to move from the native DB to SQL. We discovered this morning overflow errors when trying to restore the backup into SQL on some Sales Invoice Header records for Name and Address.
Upon checking, I discovered that the actual length of the data in the field was 31 characters despite the field length being defined as 30. Was/is there some interesting feature in the native DB that would allow this? Anyone else run into this and/or is there any way to test for this condition easily?
Thanks,
Upon checking, I discovered that the actual length of the data in the field was 31 characters despite the field length being defined as 30. Was/is there some interesting feature in the native DB that would allow this? Anyone else run into this and/or is there any way to test for this condition easily?
Thanks,
0
Answers
-
Possible someone altered the database structure in SQL?
Are you doing the restore on a freshly created SQL database?Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
No. To speed the process up we decided to simply create a new 4.0 SQL database, back up the native and restore. Both DBs define the field length of Sales Invoice Header at 30.
The strange part was the the actual data in the recor creating the overflow error was 31 characters in length in the native DB, despite the field length being 30. I would have thought that that was not possible even if the client had originally imported data into the Sales Invoice Header from another application [we were not the VAR who did the original conversion to Nav]0 -
Hi Keith,
I think this explains how your problem occured - from the application developers guideIn C/SIDE Database Server, data is stored with a four byte alignment because of
performance considerations. The sizes of text, code and binary fields (that can have
variable lengths) are rounded up to the nearest value that is a multiple of four. This
means that, for example, a text string of 10 characters will occupy 12 bytes.
so the addresses would occupy 32 bytes0 -
Sounds reasonable - Thanks much.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions