SQL2005 Case statement error

Posted on 2012-08-23
Last Modified: 2012-08-23
I'm trying to run a SPRO that has the following case statement but generates an error associated with the execute command.

What is wrong with my syntax?


 (case when len(rtrim(@FMU))=0
                        then  (((fcz.FreightList * @fWeight) * @fCustMultiVal) * @fMaxWeightFactor)
                        EXECUTE dbo.uspFC_GetTMSCost
Question by:jdr0606
    LVL 75

    Assisted Solution

    by:Aneesh Retnakaran
    you cannot execute an sp as part of your case statement
    LVL 75

    Accepted Solution

    if that sp just do some calculation and returns a numeric value,convert that sp into a user defined function an call that

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now