Options

how can i get the timestamp or key back from Navision tables

smnehalsmnehal Member Posts: 14
edited 2010-05-03 in NAV Three Tier
Hi,

I m using Navision 2009 SP1 and using web services to Create update and delete the Navision tables.

But i m using the Select statement rather using GetAll method in Navision web service due to performance,

When i using SQL Select statement from Navision table, how can i get the key or TimeStamp from Navision table using

sql select statement or stored procedure or sql view. so that i use the key or time stamp to update database using

navision update webservice.

Thanks.

Comments

  • Options
    IsakssonMiIsakssonMi Member Posts: 77
    @identity"-query to obtain the last key from a insert/(update?) statement.
  • Options
    rdebathrdebath Member Posts: 383
    For the value of the the key after an identity insert you should really use SCOPE_IDENTITY otherwise you run the risk of being really messed up by triggers.

    Timestamps are used as varbinary so there shouldn't be any problems normally, though you may occasionally need the function master.dbo.fn_varbintohexstr([timestamp]). It's officially undocumented but nevertheless present in all current versions.

    @DBTS is sufficient, even though this too will be updated by triggers and other threads, if you just need to use it for optimistic concurrency.
Sign In or Register to comment.