Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL2005 Case statement error

Posted on 2012-08-23
2
Medium Priority
?
478 Views
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?

Thanks

 (case when len(rtrim(@FMU))=0
                        then  (((fcz.FreightList * @fWeight) * @fCustMultiVal) * @fMaxWeightFactor)
else
                        EXECUTE dbo.uspFC_GetTMSCost
                              @fOrderNumber
                              ,@fMu
end)
0
Comment
Question by:jdr0606
  • 2
2 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 2000 total points
ID: 38326630
you cannot execute an sp as part of your case statement
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 total points
ID: 38326632
if that sp just do some calculation and returns a numeric value,convert that sp into a user defined function an call that
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

810 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