I want to create a table using the following script in a database called DeltaDatabase
:
CREATE TABLE [dbo].[OutStatus](
[Id] [bigint] IDENTITY(1,1) NOT NULL,
[OutId] [int] NOT NULL,
[StatusType] [varchar](255) NULL,
[StatusDate] [datetime] NULL)
I would then like to INNER JOIN
a column into this table from another database called CoreDatabase
.
The column name is sourceId
from the table Client
. So in other words OutId
needs to be foreign key of SourceId
.
How do I join that column into my OutStatus
table from the other database using the create table script?