Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search and replace

Status
Not open for further replies.

camy123

Programmer
Mar 5, 2004
171
GB
hi can some one help me or giveme some advice.. I have a column in table which is of datatype image it contains data in the format such
,,,,,,,,,,,,,,,,,1000000,\\temp,,,,,,,

I need to search through this and insert a value at a certain point(the 99th comma), can any one help me obvously ill have to cast it to varchar etc etc
 
Try the STUFF command.

For example:

Code:
SELECT STUFF('abcdefg', 3, 0, 'test')
will return abtestcdefg

The 3 is the position to start at (you would use 99 or 100 - test it) and the 0 is how many characters to delete and replace with the last value (you don't want to delete any, so it's a 0).

-SQLBill

BOL=Books OnLine=Microsoft SQL Server's HELP
Installed as part of the Client Tools
Found at Start>Programs>Microsoft SQL Server>Books OnLine

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top