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 ««123»»

Printing Lengths Expand / Collapse
Author
Message
Posted Monday, December 13, 2010 9:06 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 11, 2013 3:27 PM
Points: 127, Visits: 132
thanks

Rahul
Post #1033879
Posted Monday, December 13, 2010 9:07 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 11, 2013 3:27 PM
Points: 127, Visits: 132
thanks

Rahul
Post #1033882
Posted Monday, December 13, 2010 9:08 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 11, 2013 3:27 PM
Points: 127, Visits: 132
that's great
ur welcome


Rahul
Post #1033886
Posted Monday, December 13, 2010 9:11 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 11, 2013 3:27 PM
Points: 127, Visits: 132
thanks
n i promise i will keep ur words in mind, nxt time i post some questions..


Rahul
Post #1033891
Posted Monday, December 13, 2010 10:10 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 10:20 AM
Points: 1,740, Visits: 6,366
Once again we learn that you should never rely on default datatype precision, but specify it yourself!
Post #1033943
Posted Monday, December 13, 2010 12:06 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, January 31, 2013 8:01 AM
Points: 1,232, Visits: 1,046
Rahul The Dba (12/13/2010)
thanks
n i promise i will keep ur words in mind, nxt time i post some questions..


Rahul,
We are not able to tell who these comments are for if you do not post a quoted reply like this one.

Or at the very least include thier name in the post.

--------
I have.
Who has ever been called a "Top Poster"?
Post #1034015
Posted Monday, December 13, 2010 1:42 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, June 16, 2014 9:38 AM
Points: 2,163, Visits: 2,189
Thanks for the interesting question. Though I hope questions like this wouldn't be necessary, and that people would always specify a length on variables to keep themselves out of trouble.
Post #1034062
Posted Monday, December 13, 2010 6:11 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
Thanks for the question.



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 #1034150
Posted Monday, December 13, 2010 11:12 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, June 30, 2014 2:51 AM
Points: 2,017, Visits: 369
good one, thanks Rahul...

declare @myvariable as varchar, @len1 varchar, @len2 varchar
set @myvariable = 'hi hello how are you'
set @len1 = (select datalength(cast(@myvariable as char)))
print @len1
set @len1 = (select datalength(cast(@myvariable as varchar)))
print @len1
set @len2 = (select datalength(convert(char, @myvariable)))
print @len2
set @len2 = (select datalength(convert(varchar, @myvariable)))
print @len2

The above code generates output as
*
1
*
1


difference of char, varchar datatypes...
Post #1034198
Posted Tuesday, December 14, 2010 12:54 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 5:50 AM
Points: 1,117, Visits: 1,375
Nice question. Learn something new today...

Thanks
Post #1034221
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse