|
Posted by Mike Epprecht \(SQL MVP\) on 10/31/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]
|