SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

mikebird
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.

Lamprey
Flowing Fount of Yak Knowledge

4347 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

mikebird
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  
 New 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.06 seconds. Powered By: Snitz Forums 2000