A.SQLServerhasnobuilt-intools/facilitiestodothis.Italsodoesnothavethefacilitytorunastored-procedureonconnectionthatcouldbewritten/usedtodothis.Thereforeyouhavethefollowingchoices:-SQLServer没有这样的功能,也没有提供在连接时执行某一特定过程的功能。这里介绍几种实现的方法 1.PuttheSQLServerbehindafirewallandusethattorestrictAccess.Thisisthemostsecureandfunctionalwaytodowhatyouwant.使用防火墙,它提供了安全和你想用的工具。 2.WriteyourownODSGatewayandpointtheclientsatthatinsteadoftheSQLServer-theODSGatewaywillthendothechecking.However,thereisnothingstoppingclientsfiguringoutthecorrectSQLclient-configentriestopointstraightattheSQLServer.ThereareexamplesofODScodeintheSQLProgrammersToolkit-availableforfreedownloadfromtheMSWebsite.写自己的ODS网关代替SQLServer的客户端-在ODS网关中检查。不过,这并不能停止正常的客户端连接SQLServer。在SQLProgrammersToolkit中有一个这样的例,可以从微软站点免费下载。 3.Writeaconstantlyrunning/scheduledstored-procedurethatcheckstherelevantcolumninsysprocesses(net_address),andthenissuesaKILLcommandforanyprocessesthatshouldnotberunning.NotethatthisonlyworksforMACaddresses.Thiswayallowspeopletoconnectandpossiblymakechangesbeforetheyarespottedandkilled.写一个存储过程检查sysprocesses中的相应列(net_address) |