Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Procedure accross two databases

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-14 : 07:52:06
Lee-Anne writes "HI,

i have looked but can not seem to find how to write this stored procedure

i have one database called FNF (orders tables)
the other called BMS (workforce tables)

what i need to do is write a stored procedure that looks at both the databases.

can this be done.

thanks

Lee-Anne"

Kristen
Test

22859 Posts

Posted - 2005-12-14 : 07:56:31
Hi Lee-Anne, Welcome to SQL Team!

Something like:

SELECT Col_A, Col_B
FROM FNF.dbo.MyOrdersTable AS O
JOIN BMS.dbo.MyWorkForceTable AS WF
ON WF.MyPKColumn = O.MyPKColumn

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-14 : 07:59:40
Also use Alias names in the Columns
SELECT O.Col_A, WF.Col_B
FROM FNF.dbo.MyOrdersTable AS O
JOIN BMS.dbo.MyWorkForceTable AS WF
ON WF.MyPKColumn = O.MyPKColumn



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2005-12-14 : 08:01:43
"Also use Alias names in the Columns"

Good plan! Thanks Maddy

Kristen
Go to Top of Page
   

- Advertisement -