Solved

scalar function

Posted on 2010-08-13
5
484 Views
Last Modified: 2012-05-10
Hi experts, i a readng about scalar function, but i don't understand the difference between
Inline ad Multi-statement (please give me a transanct code)
0
Comment
Question by:enrique_aeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33431679
That shouldn't matter for scalar functions. You should check the MSDN book online regarding CREATE FUNCTION and should clear this up for you as "scalar" functions are those that are returning a single value and so typically you are doing multiple lines of code and returning a specific value. Table functions are typically referred to as inline or multi-statement. See MSDN for the difference there, but think about singular SQL queries versus those needing multiple lines.
0
 

Author Comment

by:enrique_aeo
ID: 33432833
I was reading about Table functions are typically referred to as inline or multi-statement, but i do not understand, for that reason I ask is help and better if with transact sql code
0
 
LVL 16

Accepted Solution

by:
vdr1620 earned 250 total points
ID: 33432930
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 33433185
Okay, above you indicated "scalar" so it threw me off ... I gave you the hint though: "think about singular SQL queries versus those needing multiple lines." If you have a query that is a single select statement then you can simply return it "inline" to the return clause of the function definition. If you need variables or other multi-line constructs, then you will want to define that the function returns a table and then build the table up over the function body and then return final select.
0
 

Author Closing Comment

by:enrique_aeo
ID: 33433191
perfect man
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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