Permission problem when i try to kill an inactive session

foronavisionforonavision Member Posts: 79
Hello, I try to kill an inactive session at the following way:


NombreDatabase.RESET;
IF NombreDatabase.FIND ('-') THEN;

Session.RESET;
Session.SETRANGE ("Database Name", NombreDatabase."Database Name");
Session.SETFILTER ("Idle Time", '>%1', 1800000); //a los 30m se anula la sesion
IF Session.FIND ('-') THEN
Session.DELETE (TRUE);


but when i execute this code, i get the following error:

The following SQL servers error(s) occurred:
6102,"42000", [Microsoft][ODBC SQL Server Driver][SQL Server]. The user doesn't have permission to use KILL command.
SQL: 53

How could i solve this problem? What user must have permission, navision user or sql user? Which is the permission that i must give to them?

Comments

  • ara3nara3n Member Posts: 9,256
    KILL permissions default to the members of the sysadmin fixed database role, and are not transferable.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    The account, under which you are logged into NAV must have the sysadmin role on the SQL server to be able to perform KILL.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.