组装sql字符串,丢给exec sp_executesql执行
exec sp_executesql N‘exec sp_executesql N‘‘select * from TESTTEST.dbo.Employees where [email protected]‘‘, N‘‘@title varchar(30)‘‘, @title=‘‘Employee‘‘‘
注意:这里是执行一个带有输入参数的sql语句,用两层exec sp_executesql嵌套实现
时间: 2024-11-08 09:43:46