Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 replace text at given position start end

Author  Topic 

SQLapprentice
Starting Member

29 Posts

Posted - 2012-02-17 : 02:04:11
Hi All,

Is it possible to replace a string in a text column at a given start end position?

Example

update table set text=replace(text, start, end, 'replace with');




Thanks in advance

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-02-17 : 02:14:46
use stuff()


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SQLapprentice
Starting Member

29 Posts

Posted - 2012-02-17 : 02:39:53
Hi,

I get this error:
sql> update versao set text=stuff(texto, 3,5,'olaaa');
ROR 1305 (42000): FUNCTION data.stuff does not exist
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-02-17 : 02:42:45
you are not using MS SQL Server right ?

try dbforums.com


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

SQLapprentice
Starting Member

29 Posts

Posted - 2012-02-17 : 02:49:51
MySQL
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-02-17 : 03:28:15
try forums.mysql.com

SQLTeam is MS SQL Server


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -