Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Functions

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2013-06-20 : 12:38:45

I've got a practice function made, and made a few tweaks for input and return values.

It's clearly seen in the object tree and its input date.

I tried granting exec permissions but it doesn't help

select name, theirage(dob) from [age today] the SQL uses the same table inside so unsure if I should omit that or run it this way

I see as getdate() performed by select. The input parameter should be getdate and returning age


Surprised there's no sys.functions Surprise. Worth knowing

I use SPs perfectly. How do I use my own valid func which doesn't need to be built-in ?


Msg 195, Level 15, State 10, Line 3
'theirage' is not a recognized built-in function name.

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-06-20 : 13:17:27
not sure I understand the problem. But you need to add the schema to the begining of the call:

select name, dbo.theirage(dob) from ...
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2013-06-20 : 13:25:05

Done in a second! It's a shock just because I didn't need to put dbo.[age today] in from of that table. I remember the importance of schema prefixes and across several linked servers, but my own practice and experiment shows me when needed, and when not, so home practice ain't enough. I'll keep your tip to mind
Go to Top of Page
   

- Advertisement -