2
Answers

Search into multiple columns from Single textbox !

Mohit Kapoor

Mohit Kapoor

8y
573
1
What is the best  way to search from Table(database) using a single text-box.
 
Using LIKE operator with every column name in SQL query is quite complicated when we had 10-15+ columns !!
Answers (2)
0
Dharmraj Thakur

Dharmraj Thakur

NA 4.1k 61.7k 7y
Hi Dheeraj,
 
Just Run a query of checking user's permission before delete like this...

I assuming that you have a mapping table of UserPermissions
  1. IF EXISTS(select count(*) from UserRoleMapping where UserID = 1 and RoleID = 1 and PermissionID = 1)  
  2. BEGIN  
  3.     --delete the data  
  4. END  
  5. ELSE  
  6. BEGIN  
  7.     --you have no rights to delete the data  
  8. END 
 Thats it...