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 |
|
brubaker
Starting Member
15 Posts |
Posted - 2002-11-29 : 18:45:52
|
| Background:I have been developing a website based on SQL Server 2000 and IIS 5 (ASP pages). I developed the site on my local computer (let's call it staging) and recently moved it to a hosted server (let's call it production). Everything works perfectly on staging, but I'm getting errors on production.Error:Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name'[the name of a function that my stored procedure calls]'more info:On staging, I'm the dbo. On production, I'm not; I login using a username and password, which limits me to my database only (duh!). I created all of my stored procedures locally and then ported the database using DTS. Everything showed up fine after the port, but now I get that error. I get the error both on the ASP page and if I try to execute the stored procedure remotely using Query Analyzer, so I'm pretty sure that the error is in the stored procedure or function. Once again, everything works fine on staging. The errors are only on production.Finally, the errors don't pop up unless the stored procedure uses a user-defined function. I initially created all of my functions using 'dbo.' in front of all the function names. I later realized this might not be a great idea, so I changed them all (or at least tried to) to drop the 'dbo.'.Any ideas how I can fix this? Did I give enough details? Are there any good articles on function owners? Any and all help will be greatly appreciated.ChrisEdited by - brubaker on 11/29/2002 18:46:20 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-11-29 : 18:56:38
|
| You must specify the owner name when calling a user-defined function, even if it was created under dbo. So if you created the functions under the "user1" account:SELECT user1.myFunction(col1) FROM myTableBooks Online describes how functions must be created and called. You should also consider using the owner.objectname convention when calling all of the objects in your database; tables, procedure, and views. |
 |
|
|
|
|
|
|
|