Rabu, 13 Oktober 2010
Block IP Addresses to SQL Server using a Logon Trigger
We were testing a scenario and wanted to block SQL Server connection through certain IP addresses. Here’s how we solved the requirement using a Logon TriggerCREATE TRIGGER AllowLocalOnlyON ALL SERVER FOR LOGONASBEGINDECLARE @IP Varchar(500)SET @IP = EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'varchar(500)')IF @IP IN ('172.16.255.11', '172.20.254.1', '172.26.254.12') BEGINPrint 'There I
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar