how to delete a virtual table record from sql server

AKHILAKHIL Member Posts: 22
edited 2009-06-26 in SQL General
hi all,

i write a code for deleting a virtual table record as shown below.

delete from [Sample DB].[dbo].Session
where [Sample DB].[dbo].Session.[User ID] ='xxxx'

it shows an error like
"View or function 'Sample DB.dbo.Session' is not updatable because the modification affects multiple base tables."

is it possible to delete virtual table records from sql server .suggest me.


regards
AKHIL

Comments

  • krikikriki Member, Moderator Posts: 9,115
    [Topic moved from 'NAV 2009 (formerly NAV 5.1/'6.0')' forum to 'SQL General' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • strykstryk Member Posts: 645
    The NAV "Session" table is actually a Linked Object refferring to a SQL site "View" which is based on sysprocesses and other system-tables. HEnce, you cannot delete a record from there.

    I guess the idea is to logoff a User with this automatically by some piece of TSQL code.
    To accomplish this, you should look into using the KILL command (SQL) ...
    Jörg A. Stryk (MVP - Dynamics NAV)
    NAV/SQL Performance Optimization & Troubleshooting
    STRYK System Improvement
    The Blog - The Book - The Tool
  • garakgarak Member Posts: 3,263
    To "delete" a session u can do this from NAV with filtering the session and delete it then or, and this ist the other way, u use, like Stryk saied, the KILL command.

    Read the online Help for the kill command.

    Regards
    Do you make it right, it works too!
Sign In or Register to comment.