Reading data from nvarchar(max)

afarr
Member Posts: 287
Hi,
We have a Navision table that is linked to a table in another database (DBase2, which is a SQL database, but not Navision).
We use this linked table to get data from DBase2.
A new field has now been introduced in DBase2:
NewTextField nvarchar(max)
We can store the data in NewTextField 250 characters at a time, but how can we read the data in the first place?
Note that Navision doesn't have a datatype that matches the nvarchar(max) type in SQL.
Any answers are appreciated.
Thanks.
We have a Navision table that is linked to a table in another database (DBase2, which is a SQL database, but not Navision).
We use this linked table to get data from DBase2.
A new field has now been introduced in DBase2:
NewTextField nvarchar(max)
We can store the data in NewTextField 250 characters at a time, but how can we read the data in the first place?
Note that Navision doesn't have a datatype that matches the nvarchar(max) type in SQL.
Any answers are appreciated.
Thanks.
Alastair Farrugia
0
Comments
-
I don't know if there is a development work around of some kind, but from my understanding of databases from an integration perspective, I don't think this can be done- directly at least. The metadata has to be able to be read from the client, so maybe you can copy the information from the nvarchar field into one or multiple other fields that have properties Navision can read. If there is some way of integrating the nvarchar field type into Navision that goes waaaay beyond my area of expertise. Good luck!0
-
Hi afarr,
Just an idea hope can help,
First option:
What if you create another Navision linked table and this table would be the sub table from the first linked table.
Create a trigger in SQL server to split the long text into multiple 250 string length and insert it into the sub table.
I can sense that the script trigger would be a bit tricky here. :-k
Second option:
you could use image datatype in SQL server and that would be blob datatype in Navision. Store your long text or data in this image field. In Navision C/AL you could then use stream to read or BigText to contain your data.
Note:
nvarchar datatype could contain UTF-8 encoding of text thus you should set your expectation correctly if you wish to display this text in Navision client. You would not be happy if you see many of this ?????????? in Navision. #-o
Good Luck!0 -
Thanks for your replies.
The Blob and BigText (or stream) suggestion is what I was looking for. I'll try it out later as I'm busy with other stuff now.
And once the text is broken down into smaller strings, I'll store it in some associated table as you suggested.Alastair Farrugia0 -
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV/Navision' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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