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)
 SQL 2005 Trigger Help Needed

Author  Topic 

JeffS23
Posting Yak Master

212 Posts

Posted - 2010-05-10 : 16:43:09
I am getting the following error and hoping I can get some assitance on this.

Msg 311, Level 16, State 1, Procedure cusPopulateGECounty, Line 7
Cannot use text, ntext, or image columns in the 'inserted' and 'deleted' tables.

The mDataValue field comes off my cuscustomcontrolpatientdata table and is a text object.

[CODE]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER cusPopulateGECounty ON dbo.cuscustomcontrolpatientdata
FOR INSERT , UPDATE
AS
BEGIN
SET NOCOUNT ON ;

UPDATE
pp
SET
pp.county = CAST(c.mDataValue as VARCHAR(8000))
FROM
inserted c
JOIN cuscustomcontroldetail d ON c.customcontroldetailid = d.customcontroldetailid
JOIN patientprofile pp ON c.patientprofileid = pp.patientprofileid

END
GO
[/CODE]

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2010-05-11 : 00:47:40
can you use varchar(max) instead of text in the cuscustomcontrolpatientdata table? it will probably work. text is deprecated in 2005 and beyond. use the "max" variants instead.


elsasoft.org
Go to Top of Page
   

- Advertisement -