Solved

convert datatype to varcharmax

Posted on 2010-08-27
6
272 Views
Last Modified: 2012-05-10
table1.column1 datatype is text
what are benefits of using varcharmax

how to convert column1 to varcharmax
0
Comment
Question by:rgb192
  • 3
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
vdr1620 earned 250 total points
ID: 33544506
USE Convert or Cast

CONVERT(VARCHAR(Max), ColumnName)

OR

CAST (ColumnNAme as VARCHAR(MAX))

Chck these links to find the differences..Text data type is being depercated in future versions

http://blog.sqlauthority.com/2007/05/26/sql-server-2005-replace-text-with-varcharmax-stop-using-text-ntext-image-data-types/
http://msdn.microsoft.com/en-US/library/ms189087.aspx
0
 
LVL 4

Assisted Solution

by:MSSystems
MSSystems earned 250 total points
ID: 33545323
In most instances it is never a good idea to use varchar(max). I am sure it could lead to performance degradation in some instances.

I think an expert should give a more in-depth answer, but the obvious thing to me us unnecessary memory allocations.

http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/09/bad-habits-to-kick-declaring-varchar-without-length.aspx
0
 

Author Comment

by:rgb192
ID: 33545589
varchar(max) and text

which is quicker
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 4

Expert Comment

by:MSSystems
ID: 33545635
varchar(max)
0
 
LVL 4

Expert Comment

by:MSSystems
ID: 33545646
You can not run indexes against ntext
0
 

Author Closing Comment

by:rgb192
ID: 33550994
thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question