Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 function calls and string handling

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2010-06-01 : 09:02:28
Can we create a function A which call Function B and vice versa? and Function B is not yet created.

we have a srings like below

1. aabeezx7
2. xbt3
3. 1245n5
4. axyzu56

looks like the last char is giving the count of all the char in a string, it is alpha numeric,

Can I separate them using sql.

These were the question which I was not able to answer in interview.
can any one help me in getting answers?

Regards,


-Neil

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-06-01 : 09:10:48
select substring(column,1,convert(int,right(Column,1))
should do that if the count of char is always between 1 and 9

The function-question: try it out and you will know.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

vaibhavktiwari83
Aged Yak Warrior

843 Posts

Posted - 2010-06-01 : 09:14:56
You could cross question that what abt 123404 for this string what would be count 4 or 04
or is this fix that before count any alfabet will be there ???

Vaibhav T

To walk FAST walk ALONE
To walk FAR walk TOGETHER
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2010-06-01 : 11:38:43
Regarding function, I tried to create it got created, but with error.

and other question if it is 123404 he said to separate 04 and 1234

-Neil
Go to Top of Page
   

- Advertisement -