Database restore error: "Cannot alter table"

lospet
Member Posts: 42
Hello,
I was upgrading our dynamics NAV system from version 4.0 -> 5.0. After I merged all my modified tables with the new tables I was going to restore our custom database. During the restore I receive the following error:
The following SQL Server error(s) occurred while accessing the Currency table:
4902,"42S02",[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot alter table 'DynamicsNavRazvoj_ver50SP1.dbo.Teched d_o_o_$Currency' because this table does not exist in database 'DynamicsNavRazvoj_ver50SP1'.
SQL:
ALTER TABLE "DynamicsNavRazvoj_ver50SP1"."dbo"."Teched d_o_o_$Currency" ADD CONSTRAINT "Teched d_o_o_$Currency$0" PRIMARY KEY CLUSTERED ("Code")
Can anyone help me with this problem. Is this problem a result of a wrong upgrade process?
Kind regards,
lospet
I was upgrading our dynamics NAV system from version 4.0 -> 5.0. After I merged all my modified tables with the new tables I was going to restore our custom database. During the restore I receive the following error:
The following SQL Server error(s) occurred while accessing the Currency table:
4902,"42S02",[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot alter table 'DynamicsNavRazvoj_ver50SP1.dbo.Teched d_o_o_$Currency' because this table does not exist in database 'DynamicsNavRazvoj_ver50SP1'.
SQL:
ALTER TABLE "DynamicsNavRazvoj_ver50SP1"."dbo"."Teched d_o_o_$Currency" ADD CONSTRAINT "Teched d_o_o_$Currency$0" PRIMARY KEY CLUSTERED ("Code")
Can anyone help me with this problem. Is this problem a result of a wrong upgrade process?
Kind regards,
lospet
0
Comments
-
Is there a diffrence in DataPerCompany properties of this table beetween custom database object and restoring objects?0
-
JedrzejT,
in both tables the DataPerCompany property is set to 'yes'.
Regards,
lospet0 -
-
Yes, it does exist.
lospet0 -
1) Are you restoring the DB as Sysadmin or DB_Owner? (is used account set as sysadmin or db_owner on the SQL server)?
2) Is owner of this table dbo or another account?0 -
I have the same error with Nav50 (build 24199).
I have a complete NAV backup and I'm trying to restore only a company data (not objects).
I'm using a sysadmin profile , but at the end of the restore I've got the authoriation error about ADD COSTRAINT for a clustered key on a added setup table.
After the error I can use SSManagement Studio (connecting with the same NAV profile) and see that the table is present (dbo schema) and that also the clustered key is present.
But if I try to continue the restore , I have the same error.
Does anyone have a suggestion ?
Thank you in advance0 -
We had the same problem. Here the solution:
You have object in the database how are compiled in a older version of Navision. Mark all objects and compile them. Then it works for sure
Mark0
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