You could create something like this:
CREATE TRIGGER dbo.tInsertCall ON dbo.cdr2
FOR INSERT
AS
BEGIN
DECLARE @CallDate DATETIME;
DECLARE @clid INT;
. --Add the other variables here
.
.
DECLARE @userfield SOMEDATATYPE;
SELECT TOP(1) @CallDate = INSERTED.calldate
, @clid = INSERTED.clid
... --Add the other variables here
, @userfield = INSERTED.userfield
FROM INSERTED;
EXEC Track.dbo.InsertCall @CallDate, @clid, ... /*other variables here*/, @userfield;
END
GO
This trigger will only process the 1st row from the INSERTED virtual table, since it has TOP(1) in the SELECT statement.
The better (arguable) way to do this would be to use a trigger to iterate over all the rows in INSERTED. Something like:
CREATE TRIGGER dbo.tInsertCall ON dbo.cdr2
FOR INSERT
AS
BEGIN
DECLARE @CallDate DATETIME;
DECLARE @clid INT;
. -- add the other variable declarations here
.
.
DECLARE @userfield SOMEDATATYPE;
-- use FAST_FORWARD and LOCAL to minimize locking etc
DECLARE cur CURSOR FAST_FORWARD LOCAL FOR
SELECT *
FROM INSERTED;
OPEN cur;
--Get the first row from the INSERTED table
FETCH NEXT FROM cur
INTO @CallDate, @clid, ... /* other vars here */, @userfield;
WHILE @@FETCH_STATUS=0
BEGIN
-- run the stored proc
EXEC Track.dbo.InsertCall @CallDate, @clid, .../* other vars here */, @userfield;
-- get the next row from INSERTED
FETCH NEXT FROM cur
INTO @CallDate, @clid, .../* other vars here */, @userfield;
END
CLOSE cur;
DEALLOCATE cur;
END
GO