Click here to monitor SSC
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)

Get given character's position from a string

By hxd001_810-512717,

--test

select dbo.f_firstposition('abc,def,ccc,ged',',',1)
go
Result:4
select dbo.f_firstposition('abc,def,ccc,ged',',',2)
go
Result:8
select dbo.f_firstposition('abc,def,ccc,ged',',',3)
go
Result:12
select dbo.f_firstposition('abc,def,ccc,ged',',',4)
go
Result:0

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

copy the select results into text file

copy the select results into text file

FORUM

SQL select statement results to XL file

SQL select statement results to XL file

FORUM

how do i supress cursor select set results

how do i supress cursor select set results

FORUM

Select statement of view stays 5 hours to return results......

Select statement of view stays 5 hours to return results......

FORUM

How to Group and batch select/cursor results in stored procedure

How to Groupand batch select/cursor results for e-mail

 
Contribute