Solved

How to call a sql function from different database

Posted on 2006-11-29
2
229 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 142

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now