Fiddle -
http://sqlfiddle.com/#!2/0055a1/1 One of the parameters is of Bit datatype. Though the values in DB table are only 0's and 1's, when sending the parameter from interface, it can also be a null. The foll. query gives 0 rows. I suspect the problem could be with this bit parameter.
ALTER PROCEDURE GetData
(
@username varchar(50),
@profileid uniqueidentifier,
@status bit
)
AS
BEGIN
if @username = ''
set @username = null
else
set @username = '%' + @username + '%'
if @profileid = '00000000-0000-0000-0000-000000000000'
set @profileid = null
select u.* from tbluser u
where u.deleted=0 and
(u.username like @username or u.username is null) and
(u.profileid = @profileid or u.profileid is null) and
(u.status = @status or (@status is null and u.status is null ))
END
--execute GetData null,null,null