Good morning everyone.
I am attempting to complete some basic SQL training and I continue to receive the following error when attempting to create a procedure with a variable.
"Msg 207, Level 16, State 1, Procedure GET_CD_ARTISTS, Line 8 Invalid column name 'p_CD'
The code I am using is below this line:
CREATE PROCEDURE GET_CD_ARTISTS (@p_CD VARCHAR(60))
SELECT cd.CD_TITLE, a.ARTIST_NAME
FROM COMPACT_DISCS cd, ARTIST_CDS ac, ARTISTS a
WHERE cd.COMPACT_DISC_ID = ac.COMPACT_DISC_ID
AND ac.ARTIST_ID = a.ARTIST_ID
AND cd.CD_TITLE = p_CD;
I just can't figure out where the variable is causing an invalid column error.
Thank you in advance for the help.