Solved

convert datatype to varcharmax

Posted on 2010-08-27
6
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql Permission 6 74
Query group by data in SQL Server - cursor? 3 66
Parse this column 6 35
How can I find this data? 3 28
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
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 …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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