Ever Wanted to Own and Operate a Fully Featured Dynamic DNS Service?
Now You Can With MintDNS 2009 Enterprise - - Our Award Winning Dynamic DNS (DDNS) Server Suite!!!
It's never been easier to run your own DDNS service.

Looking for free Dynamic DNS (DDNS) services? Please use our free DDNS service at http://www.dynddns.us

MintDNS Knowledge Base



Go Back
Automatic Pruning of Update Logs
 
To enable the automatic pruning of update logs run the following command from the SQL Management Studio..

T-SQL Code:
USE [mintdata]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Prune_Logs] (
     @Days int,
     @UserID nvarchar(255)
  )
AS

SET NOCOUNT ON

Delete From UpdateLogs Where Uid = @UserID And DATEDIFF(d, DD, getdate()) > @Days

ALTER PROCEDURE [dbo].[Update_Device] (
     @UserID nvarchar(255),
     @Password nvarchar(255),
     @IP nvarchar(255),
     @URL nvarchar(500)
     

   )
AS

SET NOCOUNT ON

select Host, Dom,  IP
from Records with (nolock)
WHERE UserID = @UserID
And Password = @Password
And URL = @URL



IF EXISTS ( SELECT * FROM Records with (nolock) WHERE UserID = @UserID And Password = @Password And URL = @URL) begin
UPDATE Records
SET IP = @IP,
URL = @URL
Where (URL = @URL)
End


INSERT INTO UpdateLogs
(URL, DD, IP)
VALUES (@URL, GETDATE(), @IP)

EXEC Prune_Logs @Days = '30', @UserID = @UserID


Go Back