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

  • Home
  • SEARCH
  • 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 7820443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:17:29+00:00 2026-06-02T07:17:29+00:00

Can you suggest me to improve the below Queru Please. ALTER FUNCTION GetTemplate_Lookup_id(@pid int)

  • 0

Can you suggest me to improve the below Queru Please.

 ALTER FUNCTION GetTemplate_Lookup_id(@pid int)
    RETURNS  INT
    AS
    BEGIN
    DECLARE @Return int
    SELECT @Return= CASE @pid
    -- SOME OTHER Comment
    WHEN 208 THEN  4
    WHEN 283 THEN  4
    WHEN 402 THEN  4
    WHEN 42 THEN  4

    --SOME OTHER Comment
    WHEN 211 THEN  3
    WHEN 286 THEN 3
    WHEN 399 THEN 3
    WHEN 45 THEN 3

    --SOME OTHER Comment
    WHEN 209 THEN 1
    WHEN 284 THEN 1
    WHEN 397 THEN 1
    WHEN 43 THEN 1

    --SOME Other Comment
    WHEN 210 THEN 2
    WHEN 285 THEN 2
    WHEN 398 THEN 2
    WHEN 44 THEN 2

    ELSE 0
    END
    RETURN @Return
    END
  • 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-02T07:17:32+00:00Added an answer on June 2, 2026 at 7:17 am
    CASE       
        WHEN @pid in (208, 283, 402, 42)
            THEN  4      
        WHEN @pid in (211, 286, 399, 45)
            THEN  3      
        WHEN @pid in (209, 284, 397, 43)
            THEN  1        
        WHEN @pid in (210, 285, 398, 44)
            THEN  2      
        ELSE 0     
    END 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m facing an issue with NHibernate performance and can you please suggest me some
Can someone look at my two functions below and suggest what I can do?
Wondering if anyone can suggest a good file replication tool that will replicate across
I am wondering if anyone can suggest solutions for adding together datetimes in mysql?
how can i convert eps image to jpg/png. any good application you can suggest.
Can you suggest a best way to define money type in F#?
Can anyone suggest a book or a tutorial on creating Charts in PHP extracting
Can anyone suggest a good solution to remove duplicates from nested lists if wanting
Can anyone suggest some best options to include charting feature in my ASP.NET pages
Can anyone suggest me a good papervision3D book to read? I know as3 pretty

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.