Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Use of like operator with sorting

$
0
0

Hi,

I have a stored procedure that selects staff details like firstname, familyname, email, address etc . The stored procedure accepts 1 parameter  

1) SearchString

which can be null

I need to write a stored procedure to send all students if SearchString is not provided and if SearchString is provided then it should see if either firstname contais SearchString or familyname contains SearchString  or email contains SearchString   or address contains SearchString  and should return those values. I do not want to use if blocks and write it . Is there any other way



Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>