SQL Roles

raven44raven44 Member Posts: 85
edited 2007-05-17 in SQL General
Hi,

I received an error message stating:
"8104,"42000",[Microsoft] ODBC SQL Server Driver Error. The current user is not the database or object owner of table %. Cannot perform set operation."

I have looked at http://www.mibuso.org/forum/viewtopic.php?t=7262&start=0&postdays=0&postorder=asc&highlight=

and noticed that the $ndo$shadow role is only visible in my 3.7 databases.
I am currently working on a 4.0 sp2 database.

Is there another role that v4.0 sp2 utilises?
Any suggestions would be great.

Thanks in advance

Answers

  • krikikriki Member, Moderator Posts: 9,115
    Which function did you launch? For some things you need to be DBowner or even SQLadmin.

    Since 4.00, the security system has changed. Each time you add a user or an object, or change permissions in Navision, you need to synchronize the security system on SQL. This can be a long process. To avoid that, you can make each user a DBowner on SQL, but this can be a security issue (each user can delete the DB!) if the user can access the DB from outside Navision.

    From 4.00SP3, MS added again the possibility to switch to the old security system.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • kinekine Member Posts: 12,562
    This is not about permission. This is about filling autoincrement field when inserting record. Catch the code through debugger and check the code. You need to clear the autoincrement field before inserting into table (set it to 0).

    For more info search the forum. I wrote "why" in them...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • raven44raven44 Member Posts: 85
    Its a customized function on an Order that updates a field on the Order and writes to a newly customized table.

    Synchronizing was the first step I tried, it synchronizes the user but unfortunately same error when running the function.

    Adding the dbo role to the user works but for security risks I don't think its wise to do that.

    Still stuck as to what permissions or roles (in SQL) should be added to the user with the new security structure 4.0...
    they do have $dbo$ar$############## - (that unique key)
    just wouldnt be sure which to add.
  • kinekine Member Posts: 12,562
    raven44 wrote:
    Its a customized function on an Order that updates a field on the Order and writes to a newly customized table.

    You can forget the permissions. You do not need to change anything there. You need to make the C/AL code correct. Can you post the code which is inserting the data into this new table? The error is there.

    I assume that there is just one field as primary key of type Integer (or BigInteger) and the Autoincrement property is set to Yes. In the code you are missing the code like:
      <your new record>.<PK field> := 0;
    

    In many cases is the problem hidden in one thing - that the .INIT function is not clearing the PK fields! You need to clear the PK field manually... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • raven44raven44 Member Posts: 85
    Hi,
    thanks for all your comments.
    it was the code!
    the way in which it was structured.
    was misled by the error message thinking that it was to do with SQL.
    Thanks again
  • kinekine Member Posts: 12,562
    You are welcome.

    It is hard to find the real source of this error. It is just secondary effect of the code. You will know the reason next time you will see this error... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from Navision forum to SQL General forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.