In t-sql 2012, I want to update the value in the column called stringtemplate in
the table called Templates 26 times. I want to update this value uniquely since
the value changes depending upon the row I am updating. I would like to use the
same declare of @stringtemplate, @milestone, and @language without having to
come up with other declare variables for the 26 rows. The sql I listed below
does not work for even two rows in the table being updated. I have tried lots of different version
of the sql, but nothing I have tried work. This can you show me the t-sql 2013
that I can use to accomplish my goal?
Use Test
Declare @stringtemplate varchar(max) = '
&CUR_DATE.EVAL
',
@milestone varchar(10) = '005',
@language varchar(10) = 'EN'
UPDATE Templates
SET stringtemplate = @stringtemplate
FROM [Test].[dbo].[Templates] Templates
WHERE milestone_code = @milestone
AND language = @language
set @stringtemplate varchar(max) ='
&&STU_LNAME.EVAL
br /> br /> A los Padres de',
@milestone varchar(10) = '010',
@language varchar(10) = 'ES'
UPDATE Templates
SET stringtemplate = @stringtemplate
FROM [Test].[dbo].[Templates] Templates
WHERE milestone_code = @milestone
AND language = @language