SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Equivalent Oracle's INSTR Function in SQL server

By Hannan Kravitz,

You can either use the function as a simple select statement such as

SELECT *
FROM [dbo].[INSTR] ('Hello World','l',1,1) 
in addition you can use at in cross /outer apply clause
select t.* , f.Loc
from <table> as t
CROSS APPLY dbo.INSTR (T.<Column>, <strToSearch> , <StartPosition> , <Occurance#>) f

Total article views: 508 | Views in the last 30 days: 5
 
Related Articles
FORUM

Select

Select particular table

FORUM

select statements

select statements

FORUM

select query

select query

FORUM

select count

select count

FORUM

Select query

Select query

Tags
charindex    
substring    
 
Contribute