Suppose the table has columns like akey1
, bkey2
, ckey3
and many more like it.
Is there way to search for a common value
You can also try this approach
ALTER PROCEDURE USP_GetClinicNameList
@SearchStr varchar(50)
AS
BEGIN
SET @SearchStr = RTRIM(@SearchStr) + '%'
SELECT TOP (10)
*
FROM clinic c
WHERE c.cclinicname LIKE @SearchStr
OR c.caddress1 LIKE @SearchStr
OR c.caddress2 LIKE @SearchStr
OR c.ccity LIKE @SearchStr
OR c.cstate LIKE @SearchStr
OR c.cclinicid LIKE @SearchStr
OR c.czip LIKE @SearchStr
OR c.ccliniccode LIKE @SearchStr
OR c.cphone LIKE @SearchStr
ORDER BY c.cclinicname
END
GO
hope it will be more understandable.