Point well taken... This is one of the reasons why I don't use triggers in this manner...
>Your code below did it. If in the below code, the customers table had a trigger that called an SP which did an insert into a table with an identity field, wouldn't you have returned the identity of the table used in the trigger?
>
>>That is why you don't do that...< s >.....
>>
>>>>
>>>>CREATE PROCEDURE customers_add @Name Varchar(50),@newkey INTEGER OUTPUT
>>>>
>>>>AS
>>>>
>>>> BEGIN TRANSACTION
>>>>
>>>> INSERT INTO Customers(name)
>>>> VALUES (@name)
>>>> SELECT @newKey = @@IDENTITY
>>>>
>>>> COMMIT TRANSACTION
>>>>
>>>>