我尝试以这种方式编写搜索查询
alter procedure search
@Book_ID int,
@Book_name varchar(50),
@Category_type_ID int,
@Number_of_copies int,
@Author_ID int
as
select * from Book_info
where [Book_name] like '[textboxofsearch]%'
有一个书籍信息记录,我通过名称搜索书籍,为此我首先为其创建程序......记录就像这样
bookid book_name Category_type_ID Number_of_copies Author_ID
----------------------------------------------------------------------
55 Software Engineering 2 150 39
56 mbr 5 150 44
57 Marketing Management 5 33 40
当我这样检查时:
search mbr
它向我显示了这个错误:
消息 8114,级别 16,状态 5,过程搜索,第 0
行将数据类型 nvarchar 转换为 int 时出错。