delete trigger
my question is when i delete record from table.it will insert on another table...bt point is record included with image datatype.so how it can insert with another table.pls sugest me.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Anil KumarPosted Oct 18, 2012, 12:18 PM
vikas kananiPosted Oct 18, 2012, 8:56 AM
Anil KumarPosted Oct 18, 2012, 6:57 AM
insert into tblName(fieldsName)
select fieldsName from deleted
Note: MS SQL doesn't allow image field reference in magic tables. So the above will through error if compatibility level is high i.e. 70 otherwise NULL value or Not NULL String value. There are few other data-types that cause the same issue are - ntext, text.
So, above mentioned command wouldn't work and you have to either-
1) convert data-type or
2) you can use Instead Of Trigger in place of After Trigger.