Solved

scalar function

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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