how to call scalar function in sql server 2008
Your syntax is for table valued function which return a resultset and can be queried like a table. For scalar function do
select dbo.fun_functional_score('01091400003') as [er]
how to create and call scalar function in sql server 2008
Your Call works if it were a Table Valued Function. Since its a scalar function, you need to call it like:
SELECT dbo.fn_HomePageSlider(9, 3025) AS MyResult
How to call Scalar-Valued function from Access
You should be able to make use of the SQL Server user defined function by creating a pass-through query with a DAO.QueryDef
object, as illustrated in my answer here.
Calling Scalar-valued Functions in SQL
Are you sure it's not a Table-Valued Function
?
The reason I ask:
CREATE FUNCTION dbo.chk_mgr(@mgr VARCHAR(50))
RETURNS @mgr_table TABLE (mgr_name VARCHAR(50))
AS
BEGIN
INSERT @mgr_table (mgr_name) VALUES ('pointy haired boss')
RETURN
END
GO
SELECT dbo.chk_mgr('asdf')
GO
Result:
Msg 4121, Level 16, State 1, Line 1
Cannot find either column "dbo" or the user-defined function
or aggregate "dbo.chk_mgr", or the name is ambiguous.
However...
SELECT * FROM dbo.chk_mgr('asdf')
mgr_name
------------------
pointy haired boss
How to call a scalar function in a stored procedure
try including the schema id, as in
@lastchild = dbo.getlastchild(@root)
Related Topics
Updating One Column Based on The Value of Another Column
How to Use Group by Based on a Case Statement in Oracle
Oracle, Make Date Time's First Day of Its Month
Acts-As-Taggable-On Find All Tags by Context
How to Select MySQL Rows in The Order of in Clause
Read Text File to Insert Data into Oracle SQL Table
Getting Maximum Value of Float in SQL Programmatically
Field Value Must Be Unique Unless It Is Null
Sql: How to Select a Max Value for Each Group Per Day
Find a Database with a Particular Table or Find a Table in Every Database of SQL Server
How to Extract Certain Nth Character from a String in Sql
Query Temp Table in Stored Proc Whilst Debugging in SQL 2008 Management Studio
Select Distinct Values from Multiple Columns in Same Table
How to Increase Dbms_Output Buffer
Aspentech Infoplus 21 - How to Connect and Query Data