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
 SQL Server Development (2000)
 Search for a string in a string

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-14 : 06:57:30
Prasad G writes "I need to search for a string in a string., that returns me the position of the same.
My field datatype is nvarchar(2000).Pls. tell me the function/query to find the same. I am using SQL 2000.

Thanks in advance"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-14 : 07:04:24
Select Charindex('SearchString','ActualString')


Madhivanan

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

nosepicker
Constraint Violating Yak Guru

366 Posts

Posted - 2005-09-14 : 13:08:46
Can also use PATINDEX to be able to use wildcards.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-15 : 01:26:56
>>Can also use PATINDEX to be able to use wildcards.

Thats good point


Madhivanan

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

- Advertisement -