|
create proc Search_Data
@Detail varchar (255),
@Address varchar (255),
@DAMode int
as
if @ Detail = '' set @ Detail = null
if @ Address = '' set @ Address = null
if @ DAMode = '' set @ DAMode = null
select * from DADevice
where Detail like '%' + isnull (@ Detail, Detail) + '%'
and Address like '%' + isnull (@ Address, Address) + '%'
and @DAMode like '%' + isnull (@ DAMode, DAMode) + '%'
This is a stored procedure that can be generated, but the error is:
Server: Message 245, Level 16, State 1, Process Search_Data, Line 9
A syntax error occurred while converting the varchar value '%' to a column of data type int.
Then help the boss, I ca n’t turn around! ~ Thank you! ~ |
|