Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:10:38+00:00 2026-06-17T19:10:38+00:00

i am trying to run sp its not giving any result when i replace

  • 0

i am trying to run sp its not giving any result when i replace “=” by “Like”

my query is define below,

ALTER PROCEDURE [dbo].[SelectMentor] 
    -- Add the parameters for the stored procedure here
    @Zip varchar(20)=NULL,
    @Company varchar(200)=NULL,
    @Designation varchar(100)=NULL,
    @Interest varchar(200)=NULL
    --@JobFunc varchar(200)=NULL
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    select ub.user_Id,ub.user_Fullname,up.Designation,up.Company from UserBasics UB 
inner join UserProfession up on  
ub.user_Id=up.Prof_ID 
where  (@Zip is null or ub.user_Zip = @Zip) and
    (@Interest is null or ub.user_Need = @Interest) and
--  (@JobFunc is null or m.mentor_jobFunction= @JobFunc) and
    (@Company is null or up.Company=@Company) and
    (@Designation is null or up.Designation=@Designation)

its working fine but when i replace “=” with “Like”,

select ub.user_Id,ub.user_Fullname,up.Designation,up.Company from UserBasics UB 
inner join UserProfession up on  
ub.user_Id=up.Prof_ID 
where  (@Zip is null or ub.user_Zip like '%@Zip%') and
    (@Interest is null or ub.user_Need like '%@Interest%') and
--  (@JobFunc is null or m.mentor_jobFunction= @JobFunc) and
    (@Company is null or up.Company like '%@Company%') and
    (@Designation is null or up.Designation like '%@Designation%')

its not working ???

Hopes for your Suggestions

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:10:40+00:00Added an answer on June 17, 2026 at 7:10 pm

    Try this

    select ub.user_Id,ub.user_Fullname,up.Designation,up.Company from UserBasics UB 
        inner join UserProfession up on  
        ub.user_Id=up.Prof_ID 
        where  (@Zip is null or ub.user_Zip like '%'+@Zip+'%') and
            (@Interest is null or ub.user_Need like '%'+@Interest+'%') and
        --  (@JobFunc is null or m.mentor_jobFunction= @JobFunc) and
            (@Company is null or up.Company like '%'+@Company+'%') and
            (@Designation is null or up.Designation like '%'+@Designation+'%')
    

    Raj

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am trying to run WSAD in Client login but its not starting
I'm trying to run velocity email sender program in Java 1.6 but its not
I'm trying to run JUnit4 test cases on Eclipse 3.4.2 but it's not even
I'm trying to run the sample from the sinew source code, but it's not
I am trying to run a cgi script, its a long script so i
I am trying to run a Node.js script locally and it's giving me this
I'm trying to install rails and its giving me a headache, I can't seem
I'm trying to run this SQL command but it's giving me an error that
I am trying to figure out the best way to run this query. I
I'm trying to run several similar services via ServiceBase.Run(ServiceBase[] ) but it's only running

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.