alter
PROCEDURE
test
@Sstr_String nvarchar ( 2000 )
as
-- set nocount on
begin
declare @Str nvarchar ( 2000 )
set @Str = ' charIndex( ''' + REPLACE ( @Sstr_String , ' , ' , ''' ,title)>0
or charIndex( ''' ) + ''' ,title)>0 '
declare @sql nvarchar ( 4000 )
set @sql = ' select fariqi
from TGongwen where
' + @Str
exec ( @sql )
end
go
exec test ' 最先的25万,中间 '
@Sstr_String nvarchar ( 2000 )
as
-- set nocount on
begin
declare @Str nvarchar ( 2000 )
set @Str = ' charIndex( ''' + REPLACE ( @Sstr_String , ' , ' , ''' ,title)>0
or charIndex( ''' ) + ''' ,title)>0 '
declare @sql nvarchar ( 4000 )
set @sql = ' select fariqi
from TGongwen where
' + @Str
exec ( @sql )
end
go
exec test ' 最先的25万,中间 '