I am getting this error:
Msg 195, Level 15, State 10, Line 1
‘fnParseName’ is not a recognized built-in function name.
On this query:
SELECT fnParseName(DOCTORFIRSTNAME+' ' +DOCTORLASTNAME)
FROM [PracticeandPhysician]
Here’s the code for fnParseName
create FUNCTION [dbo].[fnParseName]
(@FullName NVARCHAR(128))
RETURNS @FullNameParts TABLE (FirstName NVARCHAR(128),
Middle NVARCHAR(128),
LastName NVARCHAR(128))
AS
BEGIN
... function body that populates @FullNameParts ...
RETURN
END
Why am I getting this error?
It’s a table-valued function. So you probably meant:
Note that you can’t say:
Any more than you could say:
You can, however, say:
(Not that I have validated that your function does what you think, or does so efficiently.)
Please always use the
dbo.prefix as others have suggested.