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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

United Kingdom
529 Posts

Posted - 06/20/2013 :  12:38:45  Show Profile  Reply with Quote

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.

Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/20/2013 :  13:17:27  Show Profile  Reply with Quote
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

Aged Yak Warrior

United Kingdom
529 Posts

Posted - 06/20/2013 :  13:25:05  Show Profile  Reply with Quote

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
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000