I'm trying to access a piece of data from another table. I'm trying to reach GameName field but I don't really know how to do this.
I tried to create another procedure but this didn't really work out.
PlayerGamesList.sql
...
SELECT
    t.PlayerId,
    t.GameId,
    t.TeamId,
    t.Position
FROM
    [PlayerOnGame] t
PlayerOnGame.sql
CREATE TABLE [dbo].[PlayerOnGame]
(
    [PlayerOnGameId] BIGINT PRIMARY KEY IDENTITY NOT NULL,
    [PlayerId] BIGINT NOT NULL,
    [GameId] BIGINT NULL,
    [TeamId] BIGINT NOT NULL,
    [Position] NVARCHAR(100) NULL,
...
)
and Game.sql:
CREATE TABLE [dbo].[Game] 
(
    [GameId] BIGINT PRIMARY KEY IDENTITY NOT NULL,
    [Name]   NVARCHAR(100) NOT NULL,
    ...
)
How can I access this specific GameId? I mean how can I do something like GameId.Name?
 
     
    