Solved

scalar function

Posted on 2010-08-13
5
479 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
  • 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

21 Experts available now in Live!

Get 1:1 Help Now