私は私のSQL関数に次のコードを持っている:不正使用の副作用オペレータの挿入を
if @max_chi > -999
begin
INSERT INTO CH_TABLE(X1, X2, VALUE)
VALUES(cur_out.sessionnumber, maxpos, max_chi)
commit
end
次は、SQL Server 2008のクエリであり、それは私にエラーを与える:
Invalid use of a side-effecting operator 'INSERT' within a function.
なぜ私はこれを許可されていませんか?これを修正するにはどうすればよいですか?
[temp tables too](http://stackoverflow.com/questions/9844854/is-it-possible-to-have-temp-tables-in-a-function)のように見えますが、 TABLE variables](http://stackoverflow.com/a/9844898/1028230)を参照してください。 Go figure。 – ruffin