0
select teamid, 
       a.playerid, 
       dbo.FullName(a.playerid) as fullName, 
       Total_Hits, 
       Total_At_Bats, 
       Totals_At_Bats, 
       Batting_Avg, 
       Team_Batting_Rank, 
       All_Batting_Rank 
FROM batting

Error message received:

Msg 4104, Level 16, State 1, Line 1 The multi-part identifier "a.playerid" could not be bound.

Taslim Oseni
  • 6,086
  • 10
  • 44
  • 69
Ghana Man
  • 1
  • 4

1 Answers1

0

Simply remove the a alias cause there no a alias/table in the FROM clause, that's why you get this error message, because SQL Server can't find playerid column in a table named/aliased a

select teamid, 
       playerid, 
       dbo.FullName(playerid) as fullName, 
       Total_Hits, 
       Total_At_Bats, 
       Totals_At_Bats, 
       Batting_Avg, 
       Team_Batting_Rank, 
       All_Batting_Rank 
FROM batting

There is no column a.playerid there, unless you add an alias to your table as

FROM batting a
Ilyes
  • 14,640
  • 4
  • 29
  • 55