在函数内的'INSERT EXEC' 中对带副作用的或依赖于时间的运算符的使用无效。
以下例子是错误的,改成存储过程。
create function f_cid(@taskid varchar(100),@str1 varchar(100)) returns @t_level table(abc varchar(50) ) as begin insert into @t_level execute sp_GetValue @taskid,@str1,'' return end
另:函数也不能创建临时表,create table #tab。