473,394 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Text datatype as local variables in Trigger

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

Dec 12 '05 #1
1 11231
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: mi**@epprecht.net

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

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

<bh*********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.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

Dec 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lekeas GK | last post by:
Hi All, I am managing a small database and some of the tables need to be strings of an average length of about 2,000 characters. I decided to use the text datatype to store this information...
3
by: Zack Sessions | last post by:
I have a table that has a Text datatype column that has gotten some garbage characters in it somehow, probably from key entry. I need to remove the garbage, multiple occurances of char(15). The...
1
by: Steve | last post by:
Hi; I have a table with a TEXT datatype. Its a comment field. Right now the users who put in singlequotes are killing the web front end. The programmer responsible is fixing this issue but...
2
by: Oliver Corona | last post by:
I am wondering if anyone has any insights on the performance benefit (or detriment) of declaring local variables instead of referencing members. Is allocating memory for a new variable more...
9
by: Stefan Turalski \(stic\) | last post by:
Hi, I done sth like this: for(int i=0; i<10; i++) {...} and after this local declaration of i variable I try to inicialize int i=0;
13
by: Jake Barnes | last post by:
I saw this sentence: "The last stage of variable instantiation is to create named properties of the Variable object that correspond with all the local variables declared within the function." ...
1
by: ChrisFrohlich | last post by:
ASP.NET 2.0 with Text DataTypes: I've got a similar question going in the SQL group, but I was wondering if anyone has successfully implemented reading/writing character data from a Text datatype...
55
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
8
by: Samant.Trupti | last post by:
Hi All, I am facing a strange problem.. I am calling a function func2 from func1. Before calling func2 all the local variables in func1 looks fine and has their respective values. When...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.