建立一存储过程
create alter proc Staff_s
@name varchar(10),@id varchar(10)
as
exec('select * from Staff where [email protected]+ '=' + @id )
go
动态查询 [email protected] 是字段变量 @id是字段值变量 ,这个要怎么改才能查询成功
------解决方案--------------------
create alter proc Staff_s
@name varchar(10),@id varchar(10)
as
exec('select * from Staff where [email protected]+ '=''' + @id+'''' )
go