You are here: Re: Text datatype as local variables in Trigger « MsSQL Server « IT news, forums, messages
Re: Text datatype as local variables in Trigger

Posted by Mike Epprecht \(SQL MVP\) on 10/16/21 11:34

Hi

text, ntext and image data types are not valid as local variables in SQL
Server 7.0, 2000 and 2005.

They are now deprecated in SQL Server 2005, with their replacements being
varchar(max), nvarchar(max) and varbinary(max). Those are valid as local
variables.

text and it's friends were really complicated types and their history is
long and troublesome. It was not practical to allow them as data types for
variables.

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: mike@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

<bhavin.vyas@gmail.com> wrote in message
news:1134378870.799553.59960@g44g2000cwa.googlegroups.com...
> Friends,
>
> I would just like to know that why SQL Server doen't allow us to define
> a text data type local variable while creating trigger?
>
> I tried creating a text variable in a trigger as a local variable and
> it raises error.
>
> "Implicit conversion from data type text to nvarchar is not allowed.
> Use the CONVERT function to run this query".
>
> For this i have to use convert function in MS SQL Server.
>
> -Thanks
> Bhavin Vyas
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация