Maxi Gracias de nuevo por responder Como explique en el origen de este thread, tengo que activar una auditoria que ya me funciona en otras tablas en una que tiene 2 campos text y cuando ( dentro del trigger ) hago el insert en la tabla auditoria con un select de la tabla inserted me da el error "Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables."
Saludos PabloC ----- Original Message ----- From: Maxi Accotto To: pablo.canonico Sent: Monday, December 17, 2007 9:52 AM Subject: [dbms] Triggers de auditoria en SQL2000 Hola, los triggers internamente tienen tablas virtuales (inserted y deleted) las cuales podes usar o no contra la tabla madre, ahora no se bien que necesitas resolver con lo cual no te puedo decir si tenes o no que hacer un join ;) 2007/12/17, PabloC <[EMAIL PROTECTED]>: > > Maxi > Gracias por la respuesta > Despues de escribir mi pregunta segui buscando y encontre en los BOL lo que > aca mencionas, lo que no entiendo es esto "To retrieve the new value in > either an INSERT or UPDATE trigger, join the inserted table with the > original update table" > Tengo que hacer un join entre la tabla inserted y la original??, esto dentro > del trigger?? > > Saludos > PabloC > ----- Original Message ----- > From: Maxi Accotto > To: pablo.canonico > Sent: Friday, December 14, 2007 7:20 PM > Subject: [dbms] Triggers de auditoria en SQL2000 > > Hola, extraido de tus libros en pantalla: > > In a DELETE, INSERT, or UPDATE trigger, SQL Server does not allow > text, ntext, or image column references in the inserted and deleted > tables if the compatibility level is equal to 70. The text, ntext, and > image values in the inserted and deleted tables cannot be accessed. To > retrieve the new value in either an INSERT or UPDATE trigger, join the > inserted table with the original update table. When the compatibility > level is 65 or lower, null values are returned for inserted or deleted > text, ntext, or image columns that allow null values; zero-length > strings are returned if the columns are not nullable. > > El 14/12/07, PabloC <[EMAIL PROTECTED]> escribió: > > > > Tengo varios triggers que auditan update de tablas y guardan lo que > existia > > antes de la actualizacion en otra tabla > > Ahora lo tuve que implementar en una tabla que tiene dos campos text, pero > > al ejecutar la creacion del trigger me dice > > > > Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' > > tables. > > > > No tengo solucion?? > > Que me recomiendan que haga?? > > > > Saludos > > PabloC > > > -- > ----------------------------------------------------------- > Microsoft MVP en SQL Server > Mentor asociado en SQLTotalConsulting > Excelencia en servicios y consultoria SQLServer > www.sqltotalconsulting.com > ----------------------------------------------------------- > > > __________ NOD32 2727 (20071217) Information __________ > > This message was checked by NOD32 antivirus system. > http://www.eset.com > > -- ----------------------------------------------------------- Microsoft MVP en SQL Server Mentor asociado en SQLTotalConsulting Excelencia en servicios y consultoria SQLServer www.sqltotalconsulting.com ----------------------------------------------------------- __________ NOD32 2727 (20071217) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com
