Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

VarChar(max)?!? Expand / Collapse
Author
Message
Posted Tuesday, August 12, 2008 2:42 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, December 2, 2014 2:26 AM
Points: 1,406, Visits: 591
Glad to see a clearer explanation from Simon, had a better understanding after that.

Regards,

Phil
Post #550803
Posted Tuesday, August 12, 2008 8:48 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:58 AM
Points: 13,872, Visits: 9,600
vlad (8/11/2008)
this makes varchar(max) a special type ... necessitating special handling aka "workaround" for a bug, maybe ??


Nope. Implicit conversion can be a problem on just about any data type. Elimination of implicit conversion would be the only way to handle that, and implicit conversion has too many good uses to get rid of it because of people who don't learn how to handle it correctly.


- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #551078
Posted Tuesday, August 12, 2008 10:51 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, December 11, 2014 8:51 PM
Points: 2,389, Visits: 271
Nope. Implicit conversion can be a problem on just about any data type. Elimination of implicit conversion would be the only way to handle that, and implicit conversion has too many good uses to get rid of it because of people who don't learn how to handle it correctly.

- GSquared


Despite the fact that implicit conversion maybe good or bad, varchar(max) is a not the same type as varchar(N), 0<=N<=8000 .. something to keep in mind!
Post #551237
Posted Wednesday, August 13, 2008 7:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 4, 2009 5:29 AM
Points: 49, Visits: 12
Hi Simon,
Thank for the explanation of the question.
Post #551892
Posted Wednesday, August 13, 2008 8:19 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:58 AM
Points: 13,872, Visits: 9,600
vlad (8/12/2008)
Nope. Implicit conversion can be a problem on just about any data type. Elimination of implicit conversion would be the only way to handle that, and implicit conversion has too many good uses to get rid of it because of people who don't learn how to handle it correctly.

- GSquared


Despite the fact that implicit conversion maybe good or bad, varchar(max) is a not the same type as varchar(N), 0<=N<=8000 .. something to keep in mind!


Exactly.


- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #551940
Posted Monday, August 18, 2008 12:36 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, June 4, 2014 3:27 AM
Points: 313, Visits: 382
A real good explanation by Simon....Im quiet clear on this one..Thanks Simon:)
Post #554109
Posted Monday, September 15, 2008 6:17 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 2:16 AM
Points: 2,840, Visits: 3,983
--Step 1
Declare @Str VarChar(max);
Set @Str=Replicate(cast('*'as varchar(MAX)) ,10000)
Print Len(@Str);

--Step 2
Declare @Str VarChar(max);
Set @Str=Replicate('*' ,10000)
Print Len(@Str);


----

i m hardly got the difference between step 1 and step 2 ..please explain both ????


-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done
Post #569369
Posted Friday, July 10, 2009 1:04 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 1:11 PM
Points: 18,064, Visits: 16,097
nice to have a clear explanation.

Good question




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #751342
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse