THANKS! Need a very SImple Update Script

SQLHELPasap
Member Posts: 5
Hi All,
I am not a SQL expert but am very aware of the dangers associated with any update script for NAV. I just need to change ONE field value on ONE table (ONE line) from null to the value of "4". (I expect this to be a very benign change and accept the fact that it may not work but want to try it.) I am able to query the table and see the field without any problem. We are not able to update the table using Object Designer as we get the message that the update is not allowed as there are "ledger entries" associated with the table. This is a custom table but the field is a simple value and the ledger entries all show the value properly.
We are doing this in a back up db and want to move ahead. This is an older Classic client version of NAV (5.0) and we no longer have support on any front.
As an example: table name in NAV is XX$Task Order Detail (this is a "card" in NAV) and the field is, for example Order "Type" with the numeric values on the table of 1 through 6. Right now the "Type" is null and needs to be "2".
If someone could help me with how to write an update script I would be most grateful.
I am not a SQL expert but am very aware of the dangers associated with any update script for NAV. I just need to change ONE field value on ONE table (ONE line) from null to the value of "4". (I expect this to be a very benign change and accept the fact that it may not work but want to try it.) I am able to query the table and see the field without any problem. We are not able to update the table using Object Designer as we get the message that the update is not allowed as there are "ledger entries" associated with the table. This is a custom table but the field is a simple value and the ledger entries all show the value properly.
We are doing this in a back up db and want to move ahead. This is an older Classic client version of NAV (5.0) and we no longer have support on any front.
As an example: table name in NAV is XX$Task Order Detail (this is a "card" in NAV) and the field is, for example Order "Type" with the numeric values on the table of 1 through 6. Right now the "Type" is null and needs to be "2".
If someone could help me with how to write an update script I would be most grateful.
0
Answers
-
Since NAV doesn't allow NULL values, how could you have this situation?There are no bugs - only undocumented features.0
-
Also, if you are not familiar with T-SQL, then I'd suggest you write a NAV process-only report to handle this situation.There are no bugs - only undocumented features.0
-
bbrown wrote:Also, if you are not familiar with T-SQL, then I'd suggest you write a NAV process-only report to handle this situation.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0
-
He doesn't say this is an Entry table. In fact, he states that it's a custom table. The ledger records are related. So most likely he does not need a developer's license.There are no bugs - only undocumented features.0
-
If you search google you'll see plenty of examples. Isn't it easier to do it through SQL Management studio?0
-
I am using SQL Server Management Studio but do not have the background to write the exact update statement. I was just looking for a simple sort of "shell" if you will. I have the necessary permissions. This does not need to be over complicated, my statement is just erroring out as I am not famiiar with using this tool and am obviously missing something.... OnTuesday, I'll include the actual statement I am trying to use and the error I am getting...it is a syntax error so I have something out of order or improperly phrased..
Thanks all, have a happy and safe NEW YEAR!0 -
In Management Studio, you can edit a field unless it is non-editable. If it is non-editable, you can change the field definition in NAV then go back to Management Studio and edit it.
For one field in one row - this is a lot simpler way if you don't know SQL.David Machanick
http://mibuso.com/blogs/davidmachanick/0 -
The field is marked as editable in Object Designer. That is the reason I am in this quandry..0
-
The "editable" settiings in Object Designer has nothing to do with whether or not you can edit data directly from SQL. Niether do a user's permissions defined in NAV.There are no bugs - only undocumented features.0
-
Issue is resolved..thanks,I figured out how to write the update script myself and all is well..processing continues with no errors. Woot! \:D/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