执行带参数的SQL, sp_executesql

Syntax
sp_executesql [ @stmt = ] stmt
[ 
    {, [@params=] N'@parameter_name data_type [ OUT | OUTPUT ][,...n]' } 
     {, [ @param1 = ] 'value1' [ ,...n ] }
]

 

例1

 

例2:传出参数

 

posted on 2009-06-15 17:11  reinstallsys  阅读(1235)  评论(1编辑  收藏  举报