Jambhalheart Posted September 12, 2011 Report Posted September 12, 2011 sCo_^Y sCo_^Y sCo_^Y sCo_^Ydeclare @sample varchar(100)set @sample='12-09-2011_Maddy'Now I want only 'Maddy' to be assigned to @sample. how to split ??in programming languages , we can use split function,I don't know whether we have this here sCo_^Y sCo_^Y
qwerty1204 Posted September 12, 2011 Report Posted September 12, 2011 [quote author=BEZAWADA ROWDY link=topic=236410.msg2943060#msg2943060 date=1315848324]use substring[/quote] @gr33d
Jambhalheart Posted September 12, 2011 Author Report Posted September 12, 2011 [quote author=BEZAWADA ROWDY link=topic=236410.msg2943060#msg2943060 date=1315848324]use substring[/quote]substring works like this baaDECLARE @StringTest char(10)SET @StringTest = 'Robin 'SELECT SUBSTRING(@StringTest,3,LEN(@StringTest))But i want to split where there is an _ ( underscore) in the string valuefor ex : 120911_userid_afdbI want to split the above like into three different strings ... dynamically I don't know where there will be an _ (underscore) in string value kadha...
htnamus Posted September 12, 2011 Report Posted September 12, 2011 [url=http://sqltutorials.blogspot.com/2007/09/sql-function-split.html]http://sqltutorials.blogspot.com/2007/09/sql-function-split.html[/url]idi sudu ba
galigannarao Posted September 12, 2011 Report Posted September 12, 2011 [quote author=Maddy_Rulez link=topic=236410.msg2943090#msg2943090 date=1315848576]substring works like this baaDECLARE @StringTest char(10)SET @StringTest = 'Robin 'SELECT SUBSTRING(@StringTest,3,LEN(@StringTest))But i want to split where there is an _ ( underscore) in the string valuefor ex : 120911_userid_afdbI want to split the above like into three different strings ... dynamically I don't know where there will be an _ (underscore) in string value kadha...[/quote]nee ques naku oka rakamga ardamayindi. nuvvu exactga .netlo ela ayte implement chestamo sql lo kooda ala emayina untunda ani adugutunnavu kada.unfortunately we don have that. in sql we have to use substring method only.if this particular functionality is repitetive write a function to split the string using the substring logic as per ur req and use where ever it is required S%Hi S%Hi S%Hi
galigannarao Posted September 12, 2011 Report Posted September 12, 2011 [quote author=HS link=topic=236410.msg2943127#msg2943127 date=1315848833][url=http://sqltutorials.blogspot.com/2007/09/sql-function-split.html]http://sqltutorials.blogspot.com/2007/09/sql-function-split.html[/url]idi sudu ba[/quote] *=: *=: *=:infact nuvvu url esavu nenu salaha ichanu s%H# s%H# s%H#
nenuinthe Posted September 12, 2011 Report Posted September 12, 2011 [quote author=Maddy_Rulez link=topic=236410.msg2943090#msg2943090 date=1315848576]substring works like this baaDECLARE @StringTest char(10)SET @StringTest = 'Robin 'SELECT SUBSTRING(@StringTest,3,LEN(@StringTest))But i want to split where there is an _ ( underscore) in the string valuefor ex : 120911_userid_afdbI want to split the above like into three different strings ... dynamically I don't know where there will be an _ (underscore) in string value kadha...[/quote]once i used a .net script for this...may be we need to use cusrors...i will check...
htnamus Posted September 12, 2011 Report Posted September 12, 2011 [quote author=galigannarao link=topic=236410.msg2943135#msg2943135 date=1315848891] *=: *=: *=:infact nuvvu url esavu nenu salaha ichanu s%H# s%H# s%H#[/quote] los@r mundnu nene vesa H&T@ H&T@
galigannarao Posted September 12, 2011 Report Posted September 12, 2011 [quote author=HS link=topic=236410.msg2943154#msg2943154 date=1315849038] los@r mundnu nene vesa H&T@ H&T@[/quote][img]http://oi56.tinypic.com/d5qw8.jpg[/img]
qwerty1204 Posted September 12, 2011 Report Posted September 12, 2011 [quote author=HS link=topic=236410.msg2943127#msg2943127 date=1315848833][url=http://sqltutorials.blogspot.com/2007/09/sql-function-split.html]http://sqltutorials.blogspot.com/2007/09/sql-function-split.html[/url]idi sudu ba[/quote]single line command leda aa baa s%H#
htnamus Posted September 12, 2011 Report Posted September 12, 2011 [quote author=arey ooo samba link=topic=236410.msg2943166#msg2943166 date=1315849105]single line command leda aa baa s%H#[/quote][img]http://www.desigifs.com/sites/default/files/bemmi%20%284%29.gif?1290061501[/img][quote author=galigannarao link=topic=236410.msg2943163#msg2943163 date=1315849096][img width=228 height=182]http://oi56.tinypic.com/d5qw8.jpg[/img][/quote][img width=150 height=102]http://www.desigifs.com/sites/default/files/brahmam_style15_0.gif?1290348875[/img]
galigannarao Posted September 12, 2011 Report Posted September 12, 2011 [quote author=arey ooo samba link=topic=236410.msg2943166#msg2943166 date=1315849105]single line command leda aa baa s%H#[/quote]ade seppindi *7*^ *7*^ *7*^ ee function raasi inkekkadayina single line la vaduko @3$% @3$% @3$%
galigannarao Posted September 12, 2011 Report Posted September 12, 2011 [quote author=HS link=topic=236410.msg2943174#msg2943174 date=1315849182][img]http://www.desigifs.com/sites/default/files/brahmam_style15_0.gif?1290348875[/img][/quote]atta raa dariki @3$% @3$% @3$%
Recommended Posts