|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:32 AM
Points: 127,
Visits: 122
|
|
thanks
Rahul
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:32 AM
Points: 127,
Visits: 122
|
|
thanks
Rahul
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:32 AM
Points: 127,
Visits: 122
|
|
that's great ur welcome
Rahul
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 10:32 AM
Points: 127,
Visits: 122
|
|
thanks n i promise i will keep ur words in mind, nxt time i post some questions..
Rahul
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 9:52 AM
Points: 1,356,
Visits: 4,761
|
|
| Once again we learn that you should never rely on default datatype precision, but specify it yourself!
|
|
|
|
|
Ten 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"?
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Monday, May 13, 2013 11:21 AM
Points: 2,163,
Visits: 2,148
|
|
| 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.
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: 2 days ago @ 1:07 PM
Points: 18,733,
Visits: 12,332
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:53 AM
Points: 1,528,
Visits: 359
|
|
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...
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Today @ 7:11 AM
Points: 877,
Visits: 1,159
|
|
Nice question. Learn something new today...
Thanks
|
|
|
|