一.只允许指定IP访问数据库 创建测试账号 CREATE LOGIN testuser WITH PASSWORD = '123' GO CREATE TRIGGER [tr_connection_limit] ON ALL SERVER WITH EXECUTE AS 'sa' FOR LOGON AS BEGIN --限制test这个帐号的连接 IF ORIGINAL_LOGIN()= 'test' --允许test在本机和下面的IP登录 AND (SELECT EVENTDATA().va…