Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create TRIGGER tr_CheckIP ON ALL SERVER
- FOR LOGON
- AS
- BEGIN
- DECLARE @IPAddress NVARCHAR(50) ;
- If ORIGINAL_LOGIN()='test'
- --print ORIGINAL_LOGIN()
- begin
- SET @IPAddress = convert(NVARCHAR(50),ConnectionProperty('client_net_address'))
- --print @IPAddress
- IF NOT EXISTS ( SELECT IP
- FROM master..IPAddress
- WHERE IP = @IPAddress )
- BEGIN
- ROLLBACK
- END
- End
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement