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 2000 Forums
 Transact-SQL (2000)
 Find position of string

Author  Topic 

ramecepa
Starting Member

43 Posts

Posted - 2010-08-06 : 03:17:04
Dear All,
i want to find position of string in particular on '5124'
i want to search position of string...string is '0123456789'..

Kristen
Test

22859 Posts

Posted - 2010-08-06 : 03:20:33
SELECT CHARINDEX('5124', '0123451246789')

gives 6
Go to Top of Page

ramecepa
Starting Member

43 Posts

Posted - 2010-08-06 : 03:47:06
Hi Bro,
please check once again my question???
5124----filedname
0123456789--search string
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-06 : 03:49:42
Sorry, but you question doesn't make any sense to me, so I answered it the best I could.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-08-06 : 06:16:09
I think he means that the column name is [5124].



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-08-06 : 08:46:42
Ah, OK. So one of these perhaps:

SELECT ... FROM ... WHERE [5124] = '0123456789'
or
SELECT ... FROM ... WHERE [5124] LIKE '%0123456789%'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-08-09 : 05:24:37
Dont use numbers as object names. It should be mixing of alphabets, numbers and underscore

Madhivanan

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

ramecepa
Starting Member

43 Posts

Posted - 2010-08-10 : 03:07:34
Hi Bro,
That is one of the record in column,i want to find position of string in column,in between 0to 9 and AtoZ and ato z
Go to Top of Page
   

- Advertisement -