I am working on SQL2000. Lately I find some users repeated executing INSERT OR DELETE on SQL2000 remotely. May I disconnect these users when they execute Insert operation 5 times? How can I relize it? Or may I disconnect specified user by user name? thanks hui
You can terminate a user with KILL. Look up the KILL statement in SQL Server Books Online. But that should be the last resort. It's better to find out why the users were doing and perhaps a procedure change is in order. Linchi "hui" wrote: > I am working on SQL2000. Lately I find some users repeated executing INSERT > OR DELETE on SQL2000 remotely. May I disconnect these users when they > execute Insert operation 5 times? How can I relize it? Or may I disconnect > specified user by user name? > > thanks > > hui > > > >
Yes, you can do just about anything you want in a Trigger. Yes, see why they are doing this before cutting them off. My first question would be, however, why do they have direct table access? -- __________________________________________________________________________ William R. Vaughn President and Founder Beta V Corporation Author, Mentor, Dad, Grandpa Microsoft MVP (425) 556-9205 (Pacific time) Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition) ____________________________________________________________________________________________ "hui" wrote in message news:uhxaoZR3IHA.4500@TK2MSFTNGP06.phx.gbl... > I am working on SQL2000. Lately I find some users repeated executing > INSERT > OR DELETE on SQL2000 remotely. May I disconnect these users when they > execute Insert operation 5 times? How can I relize it? Or may I disconnect > specified user by user name? > > thanks > > hui > > >
OK, I got it, thanks "Linchi Shea" дÈëÏûÏ¢ÐÂÎÅ:6208EDA4-57B2-436F-B970-2DE49CF20993@microsoft.com... > You can terminate a user with KILL. Look up the KILL statement in SQL > Server > Books Online. But that should be the last resort. It's better to find out > why > the users were doing and perhaps a procedure change is in order. > > Linchi > > "hui" wrote: > >> I am working on SQL2000. Lately I find some users repeated executing >> INSERT >> OR DELETE on SQL2000 remotely. May I disconnect these users when they >> execute Insert operation 5 times? How can I relize it? Or may I >> disconnect >> specified user by user name? >> >> thanks >> >> hui >> >> >> >>
It sounds like more of a security and/or declarative data integrity issue. #1 Do not grant access to users who don't need it. If an unwanted user has access to the database due to their windows group membership, then instead only grant access to specific accounts or deny access to specific accounts as needed. #2 Implement a primary key that would prohibit inserting duplicate data. #3 Implement stored procedures to perform the inserts which includes additional logic to prevent inserting unneeded data. #4 Rather than granting users insert / update / delete permission, instead grant them execute permission on the specific stored procedures they need. "hui" wrote: > I am working on SQL2000. Lately I find some users repeated executing INSERT > OR DELETE on SQL2000 remotely. May I disconnect these users when they > execute Insert operation 5 times? How can I relize it? Or may I disconnect > specified user by user name? > > thanks > > hui > > > >