1.事务(基本)
GO BEGIN TRY BEGIN TRAN -- 导入数据 COMMIT TRAN END TRY BEGIN CATCH ROLLBACK TRAN END CATCH GO
2.替换ntext,text。ntext不能直接使用replace函数,所以要转化为nvarchar(max),nvarchar(max)可以存储2G的东西,可以满足一般的需求。
update dbo.News set ContentText=replace(convert(nvarchar(max),ContentText),'/www/','/NewsTxt/')
on sysforeignkeys.fkeyid = cn.id and sysforeignkeys.fkey = cn.colid
原文地址:http://chenjianjx.iteye.com/blog/222267