Takes too much time to rename a large item table

scott
Member Posts: 76
Hi everyone,
Has anyone ever had to rename a whole table of master records such as the Item table where there are many other tables that must get renamed also and where there are many, many items to rename??
I have a clients that wants to rename all the items in the item table - they have 250,000 items and it takes 2-3 minutes to rename each one. This happens if you do it manually or if you run a codeunit, report etc. If I try running the code in a database with 7,000 items it takes only a few minutes for the whole table to be renamed.
Any help on this would greatly be appreciated!
Has anyone ever had to rename a whole table of master records such as the Item table where there are many other tables that must get renamed also and where there are many, many items to rename??
I have a clients that wants to rename all the items in the item table - they have 250,000 items and it takes 2-3 minutes to rename each one. This happens if you do it manually or if you run a codeunit, report etc. If I try running the code in a database with 7,000 items it takes only a few minutes for the whole table to be renamed.
Any help on this would greatly be appreciated!
0
Comments
-
Try disabling some keys on the large tables (Item Entries, Sales Line, Purchase Line, etc.) where "Item No." is a part of the key. Then, after the renaming of all items, re-enable those keys again. And you can also open the database locally, to minimize network traffic.
Hope this helps.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Well I dont know if I am right on this one or not, but I think I am. Like most relational databases it has to update the records that it is related to. When you rename an Item doesnt it go back through all the item ledger entries along with G/L entries and update them with the new Item no.? I think it does... and well that is a very hard operation to do in a timely basis... my guess is that 2-3 minutes per item is about right... And, like what was suggested before, shut down the service and open the database locally to speed it up a little. There is my 2 cents0
-
hi.. which command can I use to rename the Item number over Report or codeunit?
I have tried with modify(true) but no results.
Can anyone help me?
best regards.
Rizal0 -
You can rename a record with ... RENAME:
From the C/SIDE online help:
<start quote>
RENAME
Use this function to change a primary key in a C/SIDE table.
[Ok]:= Record.RENAME(Value1, [Value2],...)
Ok
Data type: boolean
This tells you whether the system was able to rename the primary key or not. Typically, the system will return FALSE if the record does not exist or if you do not have permission to write to the table.
Record
Data type: record
The record that contains the primary key that you want to change.
Value1, Value2, ...
Data type: text
The new values for the primary key.
<end quote>No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Thanks luc for the answer.
I have also already tried that ways before but still no result.
It comes such error messages:
"Too many key fields were specified, so Item could not be retrieved.
The number of fields in the primary key is 1."
Do you have any idea?
Thanks before for your advice.
Regards,
Rizal0 -
Here is the code example:
Item.Rename("No.","No"+'S');
Item.VALIDATE("No.");
Item.Modify(TRUE);
Your sincerely,
Rizal0 -
Try this:
Item.GET('70000');
Item.RENAME('70000new');No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Yuhuuu.. It works!!!
Thanks a lot, Luc!!
Now we can rename 2 million item.
Have a nice weekend
Rizal0
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