Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 trigger with ntext fields

Author  Topic 

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-03-19 : 05:36:11
hi i want a trigger where using like
create TRIGGER xyz ON ab FOR UPDATE
AS
INSERT INTO abc (
PATIENT_ELIGIBILITY_ID ,ELIGIBILITY_GUID,SOURCE,PBM,[PLAN],CARD_HOLDER,CARD_HOLDER_ID,PHARMACY_BENEFIT,MAIL_ORDER_BENEFIT,
SELECT PATIENT_ELIGIBILITY_ID ,ELIGIBILITY_GUID,SOURCE,PBM,[PLAN],CARD_HOLDER,CARD_HOLDER_ID,PHARMACY_BENEFIT,MAIL_ORDER_BENEFIT,
FROM deleted
GO

not working as some of them are ntext fileds.is there any procedure helps is so can you let me show wiyh an example in doing so.

Kristen
Test

22859 Posts

Posted - 2010-03-19 : 05:40:04
You could use an INSTEAD OF trigger, but IME they are a PITA!

Better would be to change from NTEXT to NVARCHAR(MAX) - TEXT datatype is deprecated, so it will be gone from a future version of SQL - its still in SQL 2008, so perhaps the next one after that.
Go to Top of Page

rajasekhar857
Constraint Violating Yak Guru

396 Posts

Posted - 2010-03-19 : 05:45:43
i am using sql server 2005 as of now.will it helps?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-03-19 : 05:52:36
Have you solved these?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141254
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140512
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=140356
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=141505


It would be helpful to others if you post the solutions

The list keeps on going


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-03-19 : 05:58:58
"I am using sql server 2005 as of now.will it helps?"

Yeah, change the NTEXT column to NVARCHAR(MAX).
Go to Top of Page
   

- Advertisement -