This page has moved. You will be automatically redirected to its new location in 10 seconds. If you aren't forwarded to the new page, click here.

Search This Blog

Friday, December 18, 2009

SQL REPLACE

Update tbl_mytbl
Set [Content]=convert(ntext,REPLACE(convert(varchar(8000),[Content]),'ddd/pdf/','Documents/'))
where Content LIKE '%ddd/pdf/%'

REPLACE for nTEXT datatype

Update mytable
Set [Content]= cast(replace(cast([Content] as nvarchar(max)),'myfolder/pdf/','Documents/') as ntext)
where Content LIKE '%myfolder/pdf/%'

Wednesday, December 9, 2009

String or binary data would be truncated.

I was getting this error when i was trying to delete some rows from the table.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=119861