Collections:
Using User Defined Functions in Expressions in SQL Server
How To Use User Defined Functions in Expressions in SQL Server Transact-SQL?
✍: FYIcenter.com
An user defined function must return a value, which can be used in any expression as long as the return value data type matches the expression.
To execute a user defined function and use its return value in an expression, you just need to enter the schema name and the function name as a value in the expression. The tutorial exercise below shows you how use a user defined function in an expression:
USE FyiCenterData; GO -- Calling a function without schema name PRINT 'Hi there, '+Welcome(); GO Msg 195, Level 15, State 10, Line 1 'Welcome' is not a recognized built-in function name. -- Calling a function with schema name PRINT 'Hi there, '+dbo.Welcome(); GO Hi there, Welcome to FYIcenter.com
2016-12-24, 633👍, 0💬
Popular Posts:
What is mscorsvw.exe - Process - Microsoft .NET Framework NGEN in SQL Server? Process mscorsvw.exe i...
What Is a Constant or Literal in SQL Server Transact-SQL? A constant, or data literal, is a symbolic...
What Are the Underflow and Overflow Behaviors on FLOAT Literals in SQL Server Transact-SQL? If you e...
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...