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 «««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 @ 5:45 AM
Points: 40,174, Visits: 36,568
You mean like option 4?

123456789012345678901234567890 and 123456789012345678901234567890



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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: Tuesday, September 23, 2014 1:04 PM
Points: 900, Visits: 1,490
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
Post #1242192
Posted Thursday, January 26, 2012 8:11 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: Yesterday @ 11:29 AM
Points: 3,354, Visits: 2,001
Nice question. And this is why we always declare lengths for variable data types.
Post #1242208
Posted Thursday, January 26, 2012 8:34 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Friday, October 17, 2014 10:12 AM
Points: 702, Visits: 3,012
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 @ 5:45 AM
Points: 40,174, Visits: 36,568
Who knows. The cause of this is likely buried somewhere in the past.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
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


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Yesterday @ 9:24 PM
Points: 17,807, Visits: 15,728
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, October 16, 2014 4:52 PM
Points: 3,780, Visits: 1,195
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: Thursday, July 24, 2014 2:48 PM
Points: 1,379, Visits: 834
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: Thursday, October 16, 2014 11:48 AM
Points: 3,956, Visits: 3,644
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