Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345»»»

Strings and Defaults Expand / Collapse
Author
Message
Posted Thursday, January 26, 2012 7:15 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:51 AM
Points: 45,329, Visits: 43,558
You mean like option 4?

123456789012345678901234567890 and 123456789012345678901234567890



Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1242153
Posted Thursday, January 26, 2012 7:56 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Wednesday, March 2, 2016 5:17 AM
Points: 955, Visits: 1,514
Loved the question and got it right because I had issues with some old code before.
Thank you for this straightforward question!


Best regards,

Andre Guerreiro Neto

Database Analyst
http://www.softplan.com.br
MCITPx1/MCTSx2/MCSE/MCSA
Post #1242192
Posted Thursday, January 26, 2012 8:11 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: 2 days ago @ 7:57 AM
Points: 4,077, Visits: 2,300
Nice question. And this is why we always declare lengths for variable data types.
Post #1242208
Posted Thursday, January 26, 2012 8:34 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 12:28 PM
Points: 1,016, Visits: 3,650
I knew about VARCHAR defaulting to length of 1, but I learned today about the CASE/CAST 30 byte truncation.

So.

Anyone know why MS created two different default data lengths? It seems like redundant inconsistency....

Rich
Post #1242237
Posted Thursday, January 26, 2012 8:41 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 1:51 AM
Points: 45,329, Visits: 43,558
Who knows. The cause of this is likely buried somewhere in the past.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1242251
Posted Thursday, January 26, 2012 8:45 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, September 23, 2016 10:17 PM
Points: 20,008, Visits: 18,244
KWymore (1/26/2012)
Nice question. And this is why we always declare lengths for variable data types.


Agreed




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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1242262
Posted Thursday, January 26, 2012 9:02 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Thursday, September 8, 2016 4:00 PM
Points: 3,820, Visits: 1,329
I think I chose the right answer and still got it wrong. Is there a way I can confirm which answer I chose?

Thank you,
GG.


"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan

To better understand your help request, please follow these best practices.
Post #1242270
Posted Thursday, January 26, 2012 9:39 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, February 2, 2016 1:45 PM
Points: 1,379, Visits: 857
I was not aware of this. Definatly will keep this in mind for the future.
Post #1242298
Posted Thursday, January 26, 2012 9:42 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:53 AM
Points: 1,176, Visits: 778
tks for the question.
Post #1242299
Posted Thursday, January 26, 2012 1:45 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Monday, November 10, 2014 12:05 PM
Points: 3,969, Visits: 3,648
I always declare the length so I wasn't sure what the defaults were but assumed that was what the question was about.

Good question.
Post #1242445
« Prev Topic | Next Topic »

Add to briefcase «««12345»»»

Permissions Expand / Collapse