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 2:17 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:26 AM
Points: 11,194, Visits: 11,136
GilaMonster (1/26/2012)
SQL Kiwi (1/25/2012)
Backwards compatibility has a lot to answer for. I cringe slightly every time I see a variable-length data type used without an explicit maximum length value.

Only slightly?

I am practicing the art of understatement.




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #1241983
Posted Thursday, January 26, 2012 2:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 24, 2014 4:44 AM
Points: 7, Visits: 9
Good question.
Post #1241999
Posted Thursday, January 26, 2012 3:07 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 12:36 AM
Points: 13,543, Visits: 10,415
I thought such a basic question, which has appeared numerous times in the QotD, would have been easier, but apparently more than 50% - at the moment - still got it wrong.



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1242006
Posted Thursday, January 26, 2012 3:28 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 11:04 AM
Points: 1,256, Visits: 13,552
good question!!!

thanks Gail!!!!



rfr.ferrari
DBA - SQL Server 2008
MCITP | MCTS

remember is live or suffer twice!
Post #1242019
Posted Thursday, January 26, 2012 5:22 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, July 24, 2014 2:28 PM
Points: 1,393, Visits: 477
Thanks for the question

Always a good reminder now and then.
Post #1242076
Posted Thursday, January 26, 2012 5:42 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 8:26 AM
Points: 1,803, Visits: 2,168
Nice one Gail. Always good when a question has a twist that's straightforward. (I almost went for 1 and 1, until I remembered ...) Thanks!

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1242091
Posted Thursday, January 26, 2012 5:50 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, April 27, 2014 7:45 PM
Points: 1,589, Visits: 253
Good question, thansk for submitting.

http://brittcluff.blogspot.com/
Post #1242092
Posted Thursday, January 26, 2012 6:11 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 12:12 PM
Points: 581, Visits: 730
Good question, which illustrates the importance of defining the maximum data length.

Thanks,

Matt
Post #1242106
Posted Thursday, January 26, 2012 6:17 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, July 29, 2014 2:16 PM
Points: 1,861, Visits: 502
One has to wonder at what point will Microsoft add configuration switches (defaulted to force developers to use correct variable declarations) that would allow you to either work with backwards compatibility for things like this versus causing an error because you have not explicitly set the length of your varchar / nvarchar variables for new development projects. IMHO, continuing to allow syntax such as this just allows old habits to continue to live on without indicating that you have code that really needs to be addressed.
Post #1242110
Posted Thursday, January 26, 2012 6:59 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Saturday, August 16, 2014 9:15 AM
Points: 2,818, Visits: 2,557
You would have gotten me if one of the answers was
123456789012345678901234567890 and
123456789012345678901234567890
but without that I had to dig a bit deeper.

Good question, thanks.
Post #1242140
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse