>Fabio you are right.
>
>Why when I use SQL Pass Through its run OK ?
>
>SQL Pass Through use ODBC.
>
>Result in SQL profile WITH CA/ADO
>
>exec sp_executesql N'INSERT INTO "confeccao".."familia" ("CD_FAMILIA","DS_FAMILIA") VALUES (@P1,@P2)', N'@P1 varchar(4),@P2 varchar(30)', '0001', 'teste
>
>
>Result in SQL profile WITH SPT
>
>INSERT INTO familia (cd_familia,ds_familia) values ('099','testee')
>
This is the BIG problem
( I do not write other words why I would become acid too much ),
when you use a parameter,
you ( and me ) cannot control the true script sended to the backend's server side.
The interface (ADO,ODBC,...) choice exec sp_.... or put the parameter values inline,
but i have't found a bit of information on help,docs,forum,.... for control this choice.
For your problem,
try to add the SELECT SCOPE... in CA.BeforeInsert() event.
PROC BeforeInsert
cInsertCmd = m.cInsertCmd + [ SELECT scope_identity() AS id]
but i cannot help more because i don't uses CAs.
A last word:
Attention, if the SQL2000 INSTEAD TRIGGERS don't support SCOPE_IDENTITY() ( a bug for me ).
Fabio