Takže to, co chcete, je:
Update cm.bo.hotlist('08Z')
set
<EmployeeID Column> = '06D'
where
city in ('New York', 'Chicago')
Pro každého, kdo sem přijde, ano, funkce hodnot v tabulce je aktualizovatelná, pokud je aktualizovatelná základní datová sada. Ukázka kódu:
IF EXISTS(select * from sys.objects where name = 'test' and schema_id = schema_id('dbo')) BEGIN DROP TABLE dbo.test; END
CREATE TABLE dbo.test(Employee varchar(10), city varchar(10));
CREATE FUNCTION [dbo].[getEmployeeCities] ( @employee varchar(10) RETURNS TABLE AS
RETURN ( SELECT * from test where employee = @employee );
insert into dbo.test select 'A', 'Chicago';
insert into dbo.test select 'B', 'New York';
select * from dbo.test;
update dbo.getEmployeeCities('A')
set Employee = 'B'
where city = 'Chicago';
select * from dbo.test;