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 @ 2:48 AM
Points: 42,438, Visits: 35,493
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: Thursday, June 26, 2014 5:34 AM
Points: 897, Visits: 1,486
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: 2 days ago @ 6:57 PM
Points: 3,258, Visits: 1,954
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: Thursday, July 17, 2014 2:01 PM
Points: 687, Visits: 3,002
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 @ 2:48 AM
Points: 42,438, Visits: 35,493
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


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 7:31 AM
Points: 21,209, Visits: 14,891
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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
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: Yesterday @ 4:13 PM
Points: 3,786, Visits: 1,083
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
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, June 26, 2014 3:41 PM
Points: 1,378, Visits: 833
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: Today @ 7:30 AM
Points: 3,869, Visits: 3,621
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