473,668 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Working With Two Different Stored Procedures from Different Databases in Sql Server

14 New Member
Hi..,
I'm having Two Stored Procedures in Two Different Databases..

Database1 - Employee
Stored Procedure - Employee_Detail s

Database2 - Company
Stored Procedure - Company_Details



In Each Stored Procedure I Joined Three Tables(Inner Join) in both the Databases..

Now I want to Join these Two Stored Procedures from Different Databases to get My Result..

How to do this..


Thank You
Feb 25 '08 #1
3 1421
radcaesar
759 Recognized Expert Contributor
Output the 2 sp results into a temp table via a Cursor and then make the recordset available from the #temp table

Then Delete that #temp table.
Feb 25 '08 #2
debasisdas
8,127 Recognized Expert Expert
You can't join stored procedures.

Please follow as suggested in previous post.
Feb 25 '08 #3
ck9663
2,878 Recognized Expert Specialist
Try to use table function for your stored proc. That way both will return resultset that you can join.

-- CK
Feb 25 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3140
by: ZeBerg | last post by:
Is it possible to have a stored procedure in database A while calling it from database B and have it manipulate the tables in database B (whatever the calling database happens to be)? We have a large-scale app that uses many complex stored procedures, and as of now, we're copying the SPs to every new database that is created, and it will soon become a nightmare for propagating updates and fixes. We'd like to keep a master set of the SPs...
4
2038
by: Minh Tran | last post by:
In order to minimize the number of connection strings I have to use to access different databases on the same Sql Server, I was considering storing all stored procedures in just one database. I want to do this because connection pooling in my application - ASP.NET is based on this connection string. So if I need to access 6 different databases on one sql server & set 6 different connection strings, I end up creating 6 different...
10
2153
by: John A Fotheringham | last post by:
I'm trying to write a procedure that having created a new database, will then create within that new database all the tables and procedures that go with it. In doing this I'm hitting the problem that you can't issue a USE command within a procedure. So my question is either - how do I get around this?
4
4962
by: Robin Tucker | last post by:
Hi, I'm trying to determine with my program whether or not a given database supports a given feature set. To do this I'm querying for certain stored procedures in the sysobjects table and if they are present, making the assumption the database will support the given feature. The problem is I can't find a certain stored procedure in the sysobjects table, even though I know it exists and can see other similar procedures using: select...
4
1402
by: HeadScratcher | last post by:
We have written an application which splits up our customers data into their individual databases. The structure of the databases is the same. Is it better to create the same stored procedures in each database or have them in one central location and use the sp_executesql and execute the generated the SQL statement. Thank you. Mayur Patel
5
1740
by: Janick | last post by:
Following problem, hope someone can help us: We have a testserver with three test-databases for each of our current services (production servers are one machine per service). Having three databse on one server worked without a problem (except from some performance-issues...) till we created stored procedures with same name (and different parameters) in two of the databases. We use one .jar with the procedure's name to encapsulate all...
7
3210
by: JIM.H. | last post by:
Hello, Is there any difference to between SLQ string in the code and call execute query and call a stored procedure and execute the query that way concerning speed, effectiveness, reliability, …? Thanks, Jim.
9
8974
by: jyothi1105 | last post by:
Hi all, Here is some information which could help people who want to create stored procedures and execute them in their program. You can create stored procedures in two ways: Through front end or writing procedure from backend SQLServer. Back End First we'll cover how to write a stored procedure in back end. The following example is how to create a store procedure for MSSql Server:
4
2113
by: roundcrisis | last post by:
Hi there: I would like to retrive a collection with the avvaialbe stored procedures, if there are any, I m using an ODBC connection, How can this be achieved? I know u can do a select of one of the system tables with a sql server, but what happens if i dont have a sql server? Cheers
0
8462
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8381
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8797
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8656
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.