Calling Transact SQL Function 
Author Message
 Calling Transact SQL Function
Hi all,

How do I explicitly call a function to run in a specific database ?

Object_Name(112121212)

I can't use "USE Database" because it is in a SP and you can't use "USE" in
a sp

Anyone have any idea's



Fri, 12 Apr 2002 03:00:00 GMT
 Calling Transact SQL Function

If all you need is an object name, you could perform a select directly
into sysobjects instead.

select name from otherdbname..sysobjects where id = 112121212

I know, probably not what you hoped to hear ...



Quote:
> Hi all,

> How do I explicitly call a function to run in a specific database ?

> Object_Name(112121212)

> I can't use "USE Database" because it is in a SP and you can't
use "USE" in
> a sp

> Anyone have any idea's

--
The girls of the Internet - I'd go online with them every day!
- Homer Simpson

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 12 Apr 2002 03:00:00 GMT
 Calling Transact SQL Function
I'm not exactly sure what you mean.  If you mean calling a stored procedure
contained in database A from database B you can use the following syntax
    Database.owner.StoredProcedure Name

for example
    DatabaseA.dbo.MyStoredProc

Tom


Quote:
> Hi all,

> How do I explicitly call a function to run in a specific database ?

> Object_Name(112121212)

> I can't use "USE Database" because it is in a SP and you can't use "USE"
in
> a sp

> Anyone have any idea's



Fri, 12 Apr 2002 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Calls of C-functions from Transact SQL

2. Calling C-functions from transact SQL

3. Calling procedures from PL/SQl functions (called from a SQL stmt)

4. Access SQL -> Transact SQL String Functions

5. Extending Transact-SQL with external call to VB

6. Calling .NET Classes from Transact SQL

7. Calling COM object from Transact-SQL stored procedure

8. Calling Corba Servers through Transact-SQL code

9. Calling Corba Servers through Transact-SQL

10. Calling Corba Servers through Transact-SQL

11. User defined functions in Transact SQL

12. String Functions in Transact SQL


 
Powered by phpBB® Forum Software