Re: [Emerald] SQL Database Transfers

Glen Harvy ( glen@aquarius.com.au )
Tue, 24 Nov 1998 10:39:53 +1100

Dale,

I feel that after a week we are nearly there :-)

Here's the results of running the original script:-

<excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><bigger>Msg
213, Level 16, State 4

Insert error: column name or number of supplied values does not match
table definition.

</bigger></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt>

For the sake of completeness, here's what I believe to be the original
script:-

<excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><bigger>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,

sp.ConnectInfo = i.ConnectInfo ,

sp.CallerID = i.CallerID

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