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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Get numbers

Author  Topic 

dass05555
Yak Posting Veteran

55 Posts

Posted - 2008-07-01 : 07:21:48

Dear friends,

i want to get the numbers alone from the below string.

input:
'062BAB1A-F59A-4BE8-95DB-3D0CF5BCCBF4'

output:
06215948953054

Thanks in advance

cool...,

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-01 : 07:27:47
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/18/extract-only-numbers-from-a-string.aspx
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-01 : 07:35:35

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79083&SearchTerms=fnFilterString

select dbo.fnFilterString('062BAB1A-F59A-4BE8-95DB-3D0CF5BCCBF4', '[0-9]')



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-01 : 07:44:48
ABS(CHECKSUM(NEWID()))



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-01 : 16:32:12
quote:
Originally posted by Peso

ABS(CHECKSUM(NEWID()))



E 12°55'05.25"
N 56°04'39.16"


That wont give the exact number
Right?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-01 : 21:32:43
quote:
Originally posted by madhivanan

quote:
Originally posted by Peso

ABS(CHECKSUM(NEWID()))



E 12°55'05.25"
N 56°04'39.16"


That wont give the exact number
Right?

Madhivanan

Failing to plan is Planning to fail



Yes. But that might be what OP really wanted. Random number !

Also see here for Random Number generation
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69499


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -