Karen Schaefer
asked on
Using Declare variable within update statement
I need to change the text within a couple of records where the data contains the word "Annual" and change it to "Open"
declare @var1
@var1 = 'Open'
SELECT [ResourceSet]
,[ResourceType]
,[CultureCode]
,[ResourceKey]
,[ResourceValue]
,[Category]
,[Translated]
FROM [bcdevtraining].[dbo].[cm_resource_core]
--UPDATE [bcdevtraining].[dbo].[cm_resource_core]
-- SET [ResourceValue] = 'Open Enrollment'
where [ResourceValue] like '%Annual Enrollment%'
GO
First record = It's {0} & @var1 & 'Enrollment through {1}. This is your opportunity to change your benefit elections, add or modify dependents, and change beneficiaries for {0}.
Second record = Begin Your Annual Enrollment Now!
ASKER
Is there a Way to do a Mass update searching for all instances of "Annual Enrollment" and update the just that portion of the text with "Open Enrollment"?
K
K
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks for the refresher - just a little rusty.
UPDATE [bcdevtraining].[dbo].[cm_
SET [ResourceValue] = 'Open Enrollment'
where [ResourceValue] like '%Annual Enrollment%'