StumbleUpon
Share on Facebook

Tuesday, May 31, 2011

A RETURN statement with a return value cannot be used in this context. - Create Function

If this error occurs in the Create Function that uses a table then the variable after return statement should be removed

The syntax should be like

Create Function
Returns Table
(
Table Definition here
..
..
)
as
BEGIN
..
..
RETURN -- note no value is returned here
END
StumbleUpon
Share on Facebook

How to get the list of Functions in Database

How to Filter Functions from Sys.Objects

The following query will list of the Functions that are part of the database:

SELECT * FROM

sys.objects

where type in ('FN', 'IF', 'TF')
Related Posts Plugin for WordPress, Blogger...