Thanks for your answer, I appreciate it.
But, after I read the thread, I find that the thread doesn't answer my question.
SELECT @max_val = MAX(SESSIONID) + 1
FROM SYSCLIENTSESSIONS WITH (UPDLOCK)
after it retrieves the biggest value of session ID, the next process is inserting that value with another parameter needed into SYSCLIENTSESSION Table.
INSERT INTO SYSCLIENTSESSIONS (SESSIONID, SERVERID, VERSION, LOGINDATETIME, USERID, SID, USERLANGUAGE, HELPLANGUAGE, CLIENTTYPE, SESSIONTYPE, RECID, CLIENTCOMPUTER, STATUS, DATAPARTITION) VALUES (@max_val, @serverid, @versionid, @loginDateTime, @userid, @sid, @lanExt, @manExt, @clientType, @sessionType, @recid, @computerName, 1, @dataPartition)
the code seems working if you see it at a glimpse.
I decided to test it with a user, creating many sessions with it, and see if the number is incrementing like the code is written.
the test result is :

if You see at the result, the session ID is not increasing by the time when the user logged in, it's more like the number was generated randomly.
that's about it.
Thanks,
Chaidir Ali Assegaf