Solved

How to call a sql function from different database

Posted on 2006-11-29
2
266 Views
Last Modified: 2010-03-19
Following statment works
use DB1
Go
   select dbo..functionMonth(getdate())

Following statment failed
use DB2
Go
    select DB1...dbo...functionMonth(getdate())
0
Comment
Question by:Bharat Guru
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18040893
>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?

0
 
LVL 20

Accepted Solution

by:
Sirees earned 25 total points
ID: 18040904
Can you try this

use DB2
Go
 select DB1.dbo.functionMonth(getdate())
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
find SQL job run average duration 24 57
SQL Select - Help finding duplicate records 5 25
sql server cross db update 2 23
Applying Roles in Common Scenarios 3 22
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question