dbo owner needed for tables with DataPerCompany=NO ?

mgm
Member Posts: 126
We are using NAV 5.0 SP1 on SQL 2005.
I want to insert a record in a system table (2000000068) which has the property DataPerCompany=NO.
I also have the same issue with a custom table.
It seems that I need the DB Owner right on SQL 2005 to do this?
Of course I don't want users to have this right.
How can this be resolved?
I want to insert a record in a system table (2000000068) which has the property DataPerCompany=NO.
I also have the same issue with a custom table.
It seems that I need the DB Owner right on SQL 2005 to do this?
Of course I don't want users to have this right.
How can this be resolved?
0
Comments
-
1) Security model - Extended or Standard?
2) How the permissions for the users are set up? Have they the roles per company or without specific company (Company field is empty in the Member Of table)?0 -
1) Standard
2) User has NO restrictions on Company0 -
What for an error message pops up?Do you make it right, it works too!0
-
[Topic moved from 'NAV/Navision' forum to 'SQL General' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
mgm wrote:2) User has NO restrictions on CompanyJörg A. Stryk (MVP - Dynamics NAV)
NAV/SQL Performance Optimization & Troubleshooting
STRYK System Improvement
The Blog - The Book - The Tool0 -
The table is a system table: 2000000068
The user has role SUPER
The Error Message that pops up is:
The following SQL Server error(s) occurred while accessing the Record Link table:
1088,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot find the object "ECO_50SP1W1_T.dbo.Record Link" because it does not exist or you do not have permissions.
SQL:
SET IDENTITY_INSERT "ECO_50SP1W1_T"."dbo"."Record Link ON
Another user with dbo permissions in SQL does not have any problems.
What did I forget?0 -
Answer is: Some code is trying to insert new record into the "Record Link" table but is not clearing the PK field. This is common error when using Autoincrement field. Enable debugger, find the code, clear the PK field (set it to 0) before inserting the record and you are done...0
-
Thanx Kamil!0
-
You are welcome. Searching this forum for "SET IDENTITY_INSERT" will give you this answer quickly... ;-)0
-
To give you a background information for this errormessage ("SET IDENTITY_INSERT":
The reason is the fieldproperty AutoIncrement YES in the table "Record Link" on field "Link ID".
The AutoIncrement property is designed to always assign numbers automatically. If you want to insert a record, you must make sure that the value in the field is blank before you insert the record. This is even more critical when you are using the SQL Server Option. If you want to manually assign a value to a field that has the AutoIncrement property set to Yes, you must be member of the SQL Server db_owner database role for the database in question.
RegardsDo you make it right, it works too!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