Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a function for a DB not used in query join.

Status
Not open for further replies.

mrdan66

Programmer
Sep 27, 2013
1
US
thread183-786720

I have a function in one database, and reference this in a select query that joins OTHER datbases.

Ex:

SELECT MyDatabase2.Function(MyDatabase1.field as parameter),MyDatabase1.* FROM MyDatabase1 INNER JOIN MyDatabase3, etc...

I am getting this error:

"The multi-part identifier 'MyDatabase2.dbo.Function' could not be bound"

Please assist?
 
you should add the schema when using function:
Code:
SELECT MyDatabase2[COLOR=red].dbo.[/color]Function(MyDatabase1.field as parameter)
This is the full name of the function.
the same way you can't use
Code:
SELECT * FROM MyDB.Tablename


Borislav Borissov
VFP9 SP2, SQL Server
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top