[RadiusNT] Calls_insert triger not working with SQL 7

Mike Miller ( michael@abraxis.com )
Fri, 19 Mar 1999 13:17:21 -0500

Hello,

All has been working well for over a day on SQL 7, but now a problem seems
to have developed. We started getting the following message in Radius
debug mode:

"Cannot use the column prefix 'sp'. This must match the object in the
UPDATE clause 'ServerPorts'

....and accounting records are not getting ack'd. Familiar with the prefix
from the calls_insert trigger on the calls table, I disabled our
calls_insert trigger and our accounting records are receiving the proper
ack again. We now have no concurrency control (unless we use manual calls
update) and our ServerPorts are not getting updated because this trigger is
disabled. Below is a copy of our trigger in it's entirety that is
generating this message in the Radius debug mode. I also tried switching
the column prefixes with the real column names only to get an error on a
'ca' prefix that I don't even see here. Anyone have any idea what is
happening and why our calls_insert trigger is not working?

our calls_insert trigger:

CREATE TRIGGER [calls_insert] ON [Calls]
FOR INSERT
AS
UPDATE ServerPorts
SET
sp.UserName = i.UserName,
sp.AcctStatusType = i.AcctStatusType,
sp.CallDate = 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
UPDATE SubAccounts
SET
sa.TimeLeft = sa.TimeLeft - (i.AcctSessionTime/60 + 1)
FROM SubAccounts sa, inserted i
WHERE sa.Login = i.UserName
AND
sa.TimeLeft <> NULL
AND
i.AcctStatusType = 2

--====================================================  /\                          Mike A. Miller     == /--\         \/              Abraxis Networks   ==/    \ B R A  /\ I S                             ==             /                                   ==      N E T W O R K S         michael@abraxis.com====================================================

For more information about this list, including removal, pleasesee this URL: http://www.iea-software.com/maillist.html