Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Execute SQL Task issue Expand / Collapse
Author
Message
Posted Tuesday, February 12, 2013 7:51 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, April 04, 2014 4:41 AM
Points: 222, Visits: 194
Hey Erik,

I created a table #temp with one field. I inserted four rows in it. Then tried the replace statement as you did.

CREATE TABLE #temp ( word VARCHAR(100))

SELECT * FROM #temp
--saat
--bat
--hoot
--boot

SELECT REPLACE(word,'oo','**') FROM #temp
--saat
--bat
--h**t
--b**t


You must use the column name ( word in my table) in 1st expression, then the pattern (in singlequotes) in 2nd expression and the replace string pattern(in single quotes) in 3rd expression.


Hope this helps !!!

Regards,
Suresh
Post #1418976
Posted Tuesday, February 12, 2013 10:30 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 6:14 AM
Points: 6, Visits: 10
Thank you and all who responded. I had to break away for a lenghty meeting and will being trying the solutions in a bit. I'll report back the results.
Post #1419095
Posted Tuesday, February 12, 2013 12:38 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 25, 2014 6:14 AM
Points: 6, Visits: 10
Hi,

I was able to execute the following in Management studio successfully but was unable to replicate the results when using BIDS.

Update dbo.mydatabase
Set stage = REPLACE(Stage,'Closed Won','Awarded')

I tried the table solution but was not able to achieve the desired results.

Post #1419153
Posted Tuesday, February 12, 2013 12:52 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 5:59 AM
Points: 1,245, Visits: 1,387
I may be missing something here, but why not just

update mydatabase
set stage = 'Awarded' where stage = 'Closed Won'

Post #1419160
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse