You are here: how to do text replacements « MsSQL Server « IT news, forums, messages
how to do text replacements

Posted by rcamarda on 09/15/05 19:06

I am trying to do a text replacement to reflect changes where I've
stored data.
A field, backup_archive_filename, contains the url path. I've since
changed the directory structure and wish to change whats stored in the
table.
Example:
\\10.0.12.110\SQLSafe\COGNOS-DEV\2005-08-29_2017m_51s_Diff_COGNOS-DEV_cm.safe
\\10.0.12.110\SQLSafe\TLS-D-AN001\2005-08-29_2041m_11s_Diff_TLS-D-AN001_Northwind.safe

I want to change SQLSafe to SQLSafe\Diff or SQLSafe\Full depending when
there is either %Diff% or %Full% in the string to reflect the change in
the directory.

I wanted to do something like:
update backups_sets
SET backup_archive_filename = <<get first part>>+ 'SQLsafe\Diff' +<<get
last part>> where backup_archive_filename like '%_Diff_%'


I need a function for <<get first part>> like EXTRACTSTR(
backup_archive_filename, '\',3) would return '\\10.0.12.110\SQLSafe'. I
cant find a built in function that can pick apart fields based on a
seperator.
TIA
Rob

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация