Upgrade 4.02 => 6.02 SQL Error

deurges
Member Posts: 8
Hi guys,
I try to upgrade our Testsystem from NAV 4.02 to NAV 6.02.
I've executed all necessary steps till step 8 from the Upgrade Quick Guide 400_2009SP1 document.
1. Customize new standard objects.
2. Prepare for the data conversion.
3. Convert the database to Microsoft Dynamics NAV 2009 SP1.
4. In Object Designer, import the Upgrade4002009.1.fob file.
5. For each company, perform any manual data or object changes to prepare the data for step 1 of the upgrade.
6. Run codeunit 104045, Upgrade NAV 2009 Step 1.
7. On form 104001, click Delete Objects.
8. Import the new customized objects that you created in the compare and merge process (part of step 1).
When I try to import the customized tables I will get several sql error messages for some obejcts.
For example: Table 48 "Invt. Posting Buffer"
5074,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The statistics 'Posting Group 1' is dependend on column 'Location Code'.
4922,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE ALTER COLUMN Location Code failed because one or more objects access this column.
There were no customization done for this object. It's absolute standard.
I've cleared any boxes in the Maintain View, Maintain Relationships, and Maintain Defaults fields, as described in step 2.
Has anybody an idea what is going wrong?
Thanks in advance.
Regards Mike
I try to upgrade our Testsystem from NAV 4.02 to NAV 6.02.
I've executed all necessary steps till step 8 from the Upgrade Quick Guide 400_2009SP1 document.
1. Customize new standard objects.
2. Prepare for the data conversion.
3. Convert the database to Microsoft Dynamics NAV 2009 SP1.
4. In Object Designer, import the Upgrade4002009.1.fob file.
5. For each company, perform any manual data or object changes to prepare the data for step 1 of the upgrade.
6. Run codeunit 104045, Upgrade NAV 2009 Step 1.
7. On form 104001, click Delete Objects.
8. Import the new customized objects that you created in the compare and merge process (part of step 1).
When I try to import the customized tables I will get several sql error messages for some obejcts.
For example: Table 48 "Invt. Posting Buffer"
5074,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The statistics 'Posting Group 1' is dependend on column 'Location Code'.
4922,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE ALTER COLUMN Location Code failed because one or more objects access this column.
There were no customization done for this object. It's absolute standard.
I've cleared any boxes in the Maintain View, Maintain Relationships, and Maintain Defaults fields, as described in step 2.
Has anybody an idea what is going wrong?
Thanks in advance.
Regards Mike
0
Comments
-
deurges wrote:Hi guys,
I try to upgrade our Testsystem from NAV 4.02 to NAV 6.02.
I've executed all necessary steps till step 8 from the Upgrade Quick Guide 400_2009SP1 document.
1. Customize new standard objects.
2. Prepare for the data conversion.
3. Convert the database to Microsoft Dynamics NAV 2009 SP1.
4. In Object Designer, import the Upgrade4002009.1.fob file.
5. For each company, perform any manual data or object changes to prepare the data for step 1 of the upgrade.
6. Run codeunit 104045, Upgrade NAV 2009 Step 1.
7. On form 104001, click Delete Objects.
8. Import the new customized objects that you created in the compare and merge process (part of step 1).
When I try to import the customized tables I will get several sql error messages for some obejcts.
For example: Table 48 "Invt. Posting Buffer"
5074,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The statistics 'Posting Group 1' is dependend on column 'Location Code'.
4922,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER TABLE ALTER COLUMN Location Code failed because one or more objects access this column.
There were no customization done for this object. It's absolute standard.
I've cleared any boxes in the Maintain View, Maintain Relationships, and Maintain Defaults fields, as described in step 2.
Has anybody an idea what is going wrong?
Thanks in advance.
Regards Mike
Hi
I think you have some manually created sql statistics (not automatic statistics).
You must delete them to resolve this error.
Try this query on a test database:DECLARE @ownername SYSNAME DECLARE @tablename SYSNAME DECLARE @statsname SYSNAME DECLARE @sql NVARCHAR(4000) DECLARE dropstats CURSOR FOR SELECT stats.name, objects.name, schemas.name FROM sys.stats JOIN sys.objects ON stats.OBJECT_ID = objects.OBJECT_ID JOIN sys.schemas ON objects.schema_id = schemas.schema_id WHERE stats.stats_id > 0 AND stats.stats_id < 255 AND objects.is_ms_shipped = 0 AND stats.user_created <> 0 ORDER BY objects.OBJECT_ID, stats.stats_id DESC OPEN dropstats FETCH NEXT FROM dropstats INTO @statsname, @tablename, @ownername WHILE @@fetch_status = 0 BEGIN SET @sql = N'DROP STATISTICS '+QUOTENAME(@ownername)+'.'+QUOTENAME(@tablename)+'.'+QUOTENAME(@statsname) EXEC sp_executesql @sql PRINT @sql FETCH NEXT FROM dropstats INTO @statsname, @tablename, @ownername END CLOSE dropstats DEALLOCATE dropstats
this query drops manually created statistics.
Bye
MatteoReno Sistemi Navision Developer0
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