Strange Experience in MSSQL Server with ‘substring’ and ‘len’ Functions
As of all DBA a me too is a great FAN of MS SQl Server for its Flexibility, stability and versatility , though recently i experienced a strange walthrough while i was into simple string functions with length and Substring extractions
my requirement is simple one to extract a portion from a defined string , for this i have to use length of another defined string and use it as first parameter
in detail…
select substring(‘abcdefgh’,1,1)
this will return ‘a’
now insted of first ’1′ i replace length of string function as below
select substring(‘abcdefgh’,len(‘b’),1)
ir returned a null
how this happened….
But again when i tried on a different machine it worked well , i am still in a dialema how the first one happened and at that time all the procedures written was not with this kind of line but i am pretty sure it happened
MSSQL Server
2011, 2012, abcdefgh, abhilash, DBA, detail, dialema, Experience, flexibility, function, Functions, kind, len, length, line, Machine, ms sql server, MSSQL, NULL, parameter, portion, requirement, server, SQL, stability, strange experience, string function, string functions, substring, time, versatility, walthrough

Meet Author
S.Abhilash, started this blog in the later half of 2009 as a self hosting site for all his previous blogging attempts. , My way of writing and frequency of publishing may not be uniform as my resources are my projects nd issues i came across. For the last few years this blog is reacing 100 s of unique visitors each day, thanks wordpress and google for such a perfection in their software and services.
Submit Your Email For Free Updates on New Articles