Create a table from a view & retrieve data

Anthony04Anthony04 Member Posts: 3
Hello everybody,

I ask you if someone know why my table can't retrieve data from my view ?

I show what I've got :
- My SQL view and my Navision table are in the same SQL Server database.
- My SQL view asked a database on another server, it works (only for the user "A")
So, in order to anyone can read data I have to create a table in Navision which retrieves the view result.

I understood that I have to create a table with the same name and the same column names and modify properties of my table :
- My View :
vuev.jpg

- My table in Navision :
tablenav.jpg

-My table's properties :
propertiestable.jpg


When I try to run the table I have this message :
errorhi.jpg

Help please

Comments

  • strykstryk Member Posts: 645
    Hi!

    Well, first of all you have to assure that the names of all fields and the table/view itself are identical - seems to be the case.

    The datatypes must be compatibel - looks OK.

    Further, NAV requires a unique PK also for such linked objects, thus you view must ensure the "invoicenumber" is unique, maybe using the DISTINCT operator in the view?! Are your values unique?

    Then you also need to set the appropriate rights on your view, e.g.
    GRANT SELECT ON [Sales-Invoices-PID] TO PUBLIC
    


    Should work ... !?
    Jörg A. Stryk (MVP - Dynamics NAV)
    NAV/SQL Performance Optimization & Troubleshooting
    STRYK System Improvement
    The Blog - The Book - The Tool
  • krikikriki Member, Moderator Posts: 9,112
    And if Joerg's trick doesn't work, just a wild guess:
    Don't use the '-' in the name but use blanks or don't use anything to separate the words of the tablename like "SalesInvoicesPID".
    Another wild guess: maybe the collation is not correct.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Anthony04Anthony04 Member Posts: 3
    It doesn't work but thanks for your advices.

    I'm trying something else and I'll tell you
Sign In or Register to comment.