Jadi yang Anda inginkan adalah:
Update cm.bo.hotlist('08Z')
set
<EmployeeID Column> = '06D'
where
city in ('New York', 'Chicago')
Untuk semua orang yang datang ke sini, ya, fungsi nilai tabel sebaris dapat diperbarui selama kumpulan data yang mendasarinya dapat diperbarui. Contoh kode:
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;