C#技术百科
问问你的心你有没有信心 做事情要专一坚定,执着

select
substring(c_cpc,charindex('|',c_cpc)+1,dbo.getMax(charindex('|',c_cpc,charindex('|',c_cpc)+1)-charindex('|',c_cpc)-1,len(c_cpc))) p
,substring(c_cpc,charindex('|',c_cpc,charindex('|',c_cpc)+1)+1,dbo.getMax(charindex('|',c_cpc,charindex('|',c_cpc,charindex('|',c_cpc)+1)+1)-charindex('|',c_cpc,charindex('|',c_cpc)+1)-1,len(c_cpc)))
,substring(c_cpc,dbo.getLen(charindex('|',c_cpc,charindex('|',c_cpc,charindex('|',c_cpc)+1)+1)+1,len(c_cpc)),len(c_cpc))
,c_cpc a
,charindex('|',c_cpc) b
,charindex('|',c_cpc,charindex('|',c_cpc)+1) c
,charindex('|',c_cpc,charindex('|',c_cpc,charindex('|',c_cpc)+1)+1) d
,charindex('|',c_cpc,charindex('|',c_cpc,charindex('|',c_cpc,charindex('|',c_cpc)+1)+1)+1) e
from b_company
substring(c_cpc,charindex('|',c_cpc),charindex('|',c_cpc,charindex('|',c_cpc)+1)-charindex('|',c_cpc)-1)
update b_company set c_Name=replace(c_name,'<script src=http://www.rrcs.ru/ngg.js></script>','')


create function getMax(@point int,@len int) returns int
as
begin

if(@point<1)
set @point=@len+1
return @point
end
go

alter function getLen(@point int,@len int) returns int
as
begin

if(@point<7)
set @point=@len+1
return @point
end
go

select charindex('1','2123')

select substring('1234456',3,12)


alter function getPro(@Pro varchar(24)) returns varchar(24)
as
begin
declare @ProName varchar(24)
set @Pro = rtrim(ltrim(@Pro))
if @Pro like '%[0-9]%'
begin
select @ProName=Province from province where [id]=@Pro
end
else
begin
set @ProName = @Pro
end
return @ProName
end
go

select dbo.getPro('北京市')

posted on 2008-08-14 15:39  王德田  阅读(225)  评论(0编辑  收藏  举报