Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying a row with a text data type to another table using triggers

Status
Not open for further replies.

supportspecialist

Technical User
Oct 8, 2001
2
0
0
GB
Trying to copy the contents of Table A into Table B when using a delete or an update trigger. Both Table A and B have a text data type field. When updating or deleting a row in table A. I wish to copy the contents of table A to table B after the trigger has fired. Both tables have the same primary key. Table A being the used for user input and Table B used to archive the delete or update transaction.

I have tried to using the insert/select statement for a single row insert with the logical table deleted using SQL Server 7.0. Only problem I have found is that option is not available until SQL Server 2000 using the INSTEAD OF keywords.

Also, I have tried to using the TEXTPTR, UPDATETEXT, WRITETEXT and READTEXT functions with little success to insert the text data type contents from Table A to Table B.

It seems that the logical table deleted does populated the table B with the contents of table A using the insert/select statement without the text data type being inserted e.g. not possible in SQL Server 7.0. Before the statements using the above functions.

If anyone help or point me in the right direction. I would be extremely grateful.

Adrian.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top