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.
Author |
Topic |
btamulis
Yak Posting Veteran
64 Posts |
Posted - 2010-11-03 : 17:18:51
|
I want to create a function that returns the last docdate for an item in a large table (IV30300).Here's my syntax -USE FARGO;GOIF OBJECT_ID (N'item.fn_lastdocdate', N'IF') IS NOT NULL DROP FUNCTION item.fn_lastdocdate;GOCREATE FUNCTION item.fn_lastdocdate (@item char(31))RETURNS TABLEASRETURN ( select itemnmbr, max(docdate) as lastdocdate from IV30300 where @item = itemnmbr group by itemnmbr);GOWhen I parse this - it runs fine - when I execute I get this error message -Msg 2760, Level 16, State 1, Procedure fn_lastdocdate, Line 6The specified schema name "item" either does not exist or you do not have permission to use it.What am I doing wrong???? |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-11-03 : 17:43:51
|
error is pretty clear. either there is no schema named item, or u dont have permission. what is your default schema? does it work if u use dbo as schema? |
 |
|
btamulis
Yak Posting Veteran
64 Posts |
Posted - 2010-11-04 : 00:39:39
|
Thanks Russell - it does work when I use dbo instead of item. |
 |
|
|
|
|