Solved

convert datatype to varcharmax

Posted on 2010-08-27
6
281 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Suggested Solutions

Title # Comments Views Activity
How to run sql statements from SQLCMD or command line 2 66
Need help debbuging stored procedure 21 44
Are triggers slow? 7 11
What is this datetime? 1 19
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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