易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL Server TEXT类型字段字符串替换示例处理脚本

 /*--text字段的替换处理  
  --*/  
  --创建数据测试环境  
--create   table   #tb(aa   text)
declare @s_str varchar(8000),@d_str varchar(8000),  --定义替换的字符串 
        @p varbinary(16),@postion int,@rplen int,@i_Start int, @i_End int
select identity(int,1,1) as [id],newsid into # from news
select @i_Start=min([id]),@i_End=max([id]) from #
while (@i_Start<=@i_End)
begin 
  --insert into #tb(aa) select content from # where [id]=@i_Start
  select   @s_str='\'   --要替换的字符串  
  ,@d_str='!' --替换成的字符串     
  --字符串替换处理       
  select   @p=textptr(content),@rplen=len(@s_str),@postion=charindex(@s_str,content)-1 from news where newsid in (select top 1 newsid from # where [id]=@i_Start) 
  while   @postion>0  
  begin  
    updatetext   news.content   @p   @postion   @rplen   @d_str  
    select   @postion=charindex(@s_str,content)-1  from news where newsid in (select top 1 newsid from # where [id]=@i_Start)
  end 
  --truncate table #tb
 
  select @i_Start=@i_Start+1
end
 
--删除数据测试环境  
--drop   table   #tb 
drop table #


相关文档:

航空公司管理系统(VC++ 与SQL 2005)

系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
      这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......

SQL Server Management Studio中“已禁用代理 XP”

在SQL Server Management Studio中连接到SQL Server实例后,会显示“SQL Server 代理”节点。如果当前该实例的Agent服务没有启动,“SQL Server 代理”后边就会显示“(已禁用代理 XP)”。“已禁用代理”从字面上不难理解,后边的“XP”有点让人费解了,这个服务跟Windo ......

ms sql 更新表A中某列为表B中的值


ms sql 更新表A中某列为表B中的值
select *
from dbo.NT_areapin
go
select *
from dbo.NT_dict_area
update NT_areapin
set AllNamePin='PengShui'
from NT_areapin
where AreaId='486'
go
update NT_dict_area
set BriefNamePin = NT_areapin.BriefNamePin,AllNamePin = NT_areapin.AllNamePin
from N ......

巧用动态宏实现SQL中传递重复参数

润乾报表可以通过SQL检索和复杂SQL生成数据集。当SQL中需要传入多个参数时,要在设计器中通过 配置-参数 定义相应的参数,然后再把SQL中需要参数的地方替换成?,最后还要在SQL编辑器中添加对应?的参数。这样当SQL中有多少个问号,我们就需要添加多少个参数。当SQL中用到的参数比较少时,操作起来还比较方便。但当业务比较复 ......

SQL手工注射原理

     关于SQL注入(SQL Injection)的方法其实都很普遍和使用,归纳起来也很方便。一般“黑客”使用的是现成的工具如“WEB旁注、阿D网络工具包、教主XXX”等这些都是集成了
一些常用的sql注入语句。下面我将介绍如何使用手工注入MYSQL,MSSQL数据库.
    一般漏洞产 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号