执行动态SQL,exec和exec sp_executesql

二者均可以执行动态sql sp_executesql  能够在动态 sql 中使用变量,而且将变量输出 exec 则只能执行动态 sql 和 存储过程,也可使用表变量,执行时须要加括号,惟一不足就是不能够输出变量 create table t_test(id int,name varchar(10),value int) declare @v_count int,@n_avgnum numeric
相关文章
相关标签/搜索