-4
可能重复:
Parameterizing an SQL IN clause?在SQL Server中传递参数 “IN子句” 2008年
我使用的是下面的过程 这里我使用 “条款” 为attendancecodeid它接受inetger的价值,我怎么可以从vb.net传递参数给我的“sql程序中的子句”,我试过很多东西没有为我寻找解决方案,
alter procedure MPEX_SP_ActivityException_Select
@startDate date,@endDate date,@AttCode nvarchar(max)
as
begin
set nocount on
select e.employeeId,e.Badge,e.LastName,e.FirstName,a.Date,ac.code
from employee e join attendance a on a.fkEmployee=e.employeeId
join attendancecodes ac on ac.attendancecodesid=a.fkattendancecode
where a.Date between @startDate and @endDate and ac.code in (@AttCode)
end
go
在此先感谢
Arasu
嗨你能告诉我@AttCode的价值 – 2012-02-27 15:28:16
重复[参数化SQL IN子句?](http://stackoverflow.com/questions/337704/parameterizing-an-sql-in-clause)或http://stackoverflow.com/questions/2944511/sql-server-in-clause-with-a-declared-variable或其他100人 – gbn 2012-02-27 15:34:27