Berikut adalah contoh cara meneruskan parameter bernilai tabel ke sp_executesql . Variabel harus diteruskan readonly :
if exists (select * from sys.types where name = 'TestTableType')
drop type TestTableType
create type TestTableType as table (id int)
go
declare @t TestTableType
insert @t select 6*7
exec sp_executesql N'select * from @var', N'@var TestTableType readonly', @t
Ini akan mencetak Pertanyaan Utama tentang Kehidupan,2842. , dan Semuanya .