How to call a sql function from different database

Following statment works
use DB1
   select dbo..functionMonth(getdate())

Following statment failed
use DB2
    select DB1...dbo...functionMonth(getdate())
Bharat GuruAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

SireesConnect With a Mentor Commented:
Can you try this

use DB2
 select DB1.dbo.functionMonth(getdate())
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Following statment failed
what error message?

now, how comes you have 2 resp 3 dots in between the database, dbo and function names? typo during posting?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.