Error on Renaming Company on SQL Server database

rashidkhan
Member Posts: 4
Dear All,
I am getting the following error while trying to rename the company on a SQL Server database from Nav 2009 Sp1 Client.Kindly help.
Microsoft Dynamics NAV Classic
The following SQL Server error or errors occurred when accessing the Trans. Sales Entry table:
15336,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Object '"TESTDB"."dbo"."XYZ$Trans_ Sales Entry"' cannot be renamed because the object participates in enforced dependencies.
SQL:
{CALL [sp_rename](?, ?, ?)}
I am getting the following error while trying to rename the company on a SQL Server database from Nav 2009 Sp1 Client.Kindly help.
Microsoft Dynamics NAV Classic
The following SQL Server error or errors occurred when accessing the Trans. Sales Entry table:
15336,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Object '"TESTDB"."dbo"."XYZ$Trans_ Sales Entry"' cannot be renamed because the object participates in enforced dependencies.
SQL:
{CALL [sp_rename](?, ?, ?)}
0
Comments
-
One thought that crosses my mind is that you might have checked the 'Maintain Relationships' for your database. This will create foreign keys in SQL Server. You can give it a try after unchecking this.
0 -
AFAIK the releations set by "Maintain Relations" are not enforced. So I'm thinking that is not the issue. I'd suspect a change directly in SQL. But I could be wrong.
Go to SSMS and run "View Dependencies" on that table.There are no bugs - only undocumented features.0 -
Thanx Chinmoy for the reply.
But there is no tick on Maintain Relationships.0 -
Check in SQL Server Studio Manager to see if you have any SQL indexes created on the table outside of NAV - I.e. Not in the usual NAV structure of companyname$tablename$number - if so then try deleting it/them then renaming the company and then recreating if required.0
-
rashidkhan wrote:Thanx Chinmoy for the reply.
But there is no tick on Maintain Relationships.
I suggest that you "View Dependencies" on the table from SQL Server Management Studio. If there are any which is out of NAV (i.e. created from SQL, then delete them and retry.0 -
@ Chinmoy and Kishorm,
Thanks a lot for the help.
I deleted all the views of the Trans. Sales Entry table in SSMS. After that I was able to rename the company and then I compiled and redesigned the table in NAV.0 -
This is true of any views in the database that are created. You have to DROP the views (and delete the linked tables if they exist), rename the company, then recreate the views.Ron0
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