SQLTeam.com | Weblogs | Forums

Create Table and add constraint

Create Table and constraint from two different databases?

LBR.StorePayCycle table and LBR.PaySchedule table which is in the same database name POSLabor but the tbl.UnitDescription table is in another database which is LANDRY_DATA database. Any Help is appreciated!!!

What have you got so far? Is the second database on the same instance? If not is the instance linked?

Same instance

select -- your list here
from database1.schema.table t1
join dababase2.schema.table t2 -- your criteria here

Notice I have not given too much information as you have not shown what you have so far.

I have created a table Labor.LBR_StorePayScale but i need to relate this to other two tables where one table is in different database.