Ok. Thats the reason. The new trigger expects to find ConnectInfo and
CallerID fields in your Calls table and ServerPorts table. If you don't
have those fields, remove the two lines:
CREATE TRIGGER calls_insert ON dbo.Calls
FOR INSERT
AS
DECLARE @ast int
UPDATE ServerPorts
Set sp.UserName = i.UserName,
sp.AcctStatusType = i.AcctStatusType,
sp.CallDate = DateAdd(Second, 0-i.AcctDelayTime, i.CallDate),
sp.FramedAddress = i.FramedAddress
FROM Servers s, ServerPorts sp, inserted i
WHERE s.IPAddress = i.NASIdentifier AND
s.ServerID = sp.ServerID AND
sp.Port = i.NASPort AND
(sp.CallDate <= DateAdd(Second, 0-i.AcctDelayTime, i.CallDate) OR
sp.CallDate IS NULL)
Select @ast=i.AcctStatusType From inserted i
IF @ast = 2
BEGIN
Insert INTO CallDetails
Select DateAdd(Second, 0-i.AcctDelayTime, i.CallDate), i.UserName,
i.AcctSessionTime,
i.FramedAddress, i.NASIdentifier, i.CallerID
Where sa.Login = i.username or sa.shell = i.username or sa.Email =
i.username),
From inserted i
Where i.UserName is not NULL and i.UserName <> 'NULL'
END
UPDATE Emerald..SubAccounts
Set sa.TimeLeft = sa.TimeLeft - (i.AcctSessionTime/60 +
1)
FROM Emerald..SubAccounts sa, inserted i
WHERE sa.login = i.UserName
and sa.TimeLeft <> NULL
and i.AcctStatusType = 2
GO
-- Dale E. Reed Jr. (daler@iea-software.com)_________________________________________________________________ IEA Software, Inc. | RadiusNT, Emerald, and NT FAQs Internet Solutions for Today | http://www.iea-software.com