How can I check any row of database has updated or not through update query
-
Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards
-
Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards
The better option is to maintain a user session table and put an entry in it when user loggs in.. Then while logging in you can check whether that particular user id is already made an entry in the table and restrict accordingly. Remember to delete this entry on a session end or logoff
Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .
-
The better option is to maintain a user session table and put an entry in it when user loggs in.. Then while logging in you can check whether that particular user id is already made an entry in the table and restrict accordingly. Remember to delete this entry on a session end or logoff
Shyam my blog dotnetscoups.blogspot.com . swthoughts.blogspot.com .
Thanks for reply, I have already done thats a way which you are suggested. It works perfectally in normal situation but when I login same user in two different system at same time, then the problem occurs. Both the system executes query at same time and retrives the same result from database. Thats the area where problem occurs.
-
Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards
-
Hi All, In MS SQL 2000, How can I check any row of database has updated or not through update query. My basic problem is that, same user has logged on two different system when they login at same time. I want to restrict the second user for login with same name. Regards
I don't know much about it, as I never used it myself, but maybe you could use a trigger that stores the db and row name somewhere when it's being updated and check that later.
-
Thanks for reply, I have already done thats a way which you are suggested. It works perfectally in normal situation but when I login same user in two different system at same time, then the problem occurs. Both the system executes query at same time and retrives the same result from database. Thats the area where problem occurs.
You can use the database transactions properly to lock and allow only one user/transaction at a time. So the first user who get the access could login and the later will not. Since already one entry is there. :-D
Shyam.. My Blog dotnetscoups.blogspot.com
-
Few questions: - Are you using a single database (all connections go to the same database)? - is the connection alive all the time the user is logged into the system?
The need to optimize rises from a bad design.My articles[^]