LearnItFirst User Forum

New SQL Server 2008 DBA Course
Welcome Guest Search | New Posts | Members | Log In | Register

Triggers - are not supporting Text,Image data types Options
fairDmaster
Posted: Monday, November 19, 2007 11:36:05 AM
Rank: Newbie

Joined: 11/16/2007
Posts: 2
Points: 12
Where do you live?: INDIA
Hi Scott,

I cant able to use TEXT and IMAGE datatype using TRIGGERS.


sample code:

********************************

CREATE TRIGGER TRG_INSERT_LOG ON dbo.LogTable

AFTER INSERT

AS

BEGIN
INSERT INTO LogDescrition,LogImage
SELECT Description,Image from INSERTED;

END

********************************

while running this query system shows the error ;
It wont support the TEXT,IMAGE datatype in TRIGGERS.

pls. advise how to use data type like TEXT,IMAGE in TRIGGERS?




Best Regards,

fair...trying2...b...a...Master
--------------------------------------------
Scott Whigham
Posted: Wednesday, November 21, 2007 4:53:46 AM


Rank: Super Mod

Joined: 3/20/2006
Posts: 460
Points: 1,002
Where do you live?: Dallas, TX
fairDmaster wrote:
pls. advise how to use data type like TEXT,IMAGE in TRIGGERS?
You can't use text/image datatypes in a trigger but you can use VARCHAR(MAX) and VARBINARY(MAX) - are you using SQL 2005?
fairDmaster
Posted: Wednesday, November 21, 2007 4:59:58 AM
Rank: Newbie

Joined: 11/16/2007
Posts: 2
Points: 12
Where do you live?: INDIA
Hi Scott,

Thanks for the reply.


Yes! I'm using SQL server 2005, in that in table i have colums like text,image datatypes.
But in triggers they are not supported.. Without changing the table data type is this possible to convert and use it in triggers?

Awaiting with thanks!


Best Regards,

fair...trying2...b...a...Master
--------------------------------------------
Scott Whigham
Posted: Wednesday, December 19, 2007 1:20:26 PM


Rank: Super Mod

Joined: 3/20/2006
Posts: 460
Points: 1,002
Where do you live?: Dallas, TX
Oops - missed this one Smile

I don't know how you could do what you're asking. Here's the rule: "No text/image datatypes in a trigger." Here's your request: "Yeah, but I want to - how can I?" I don't know of a way you can circumvent this rule Frown Sorry Frown
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.