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)
 Character in String

Author  Topic 

taylo
Yak Posting Veteran

82 Posts

Posted - 2002-04-14 : 17:29:58
I am trying to find the "@" inside a string in a stored procedure.
Is there any way to do this? I am looking for something similar to IndexOf or INSTR.

Thanks,

Rob

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-04-14 : 18:42:20
The CHARINDEX() function will do it:

SELECT CHARINDEX('@', '123456@890') --returns 7

If the character is not found, CHARINDEX() will return zero.

Go to Top of Page
   

- Advertisement -