What did I do wrong?

UPDATE HW.COURSE

SET PREREQUISITE= 'Systems Analysis'

WHERE PREREQUISITE= '140';

SELECT * FROM HW.COURSE;

ERROR MESSAGE:

Msg 245, Level 16, State 1, Line 4

Conversion failed when converting the varchar value 'Systems Analysis' to data type int.

1 Answer

Relevance
  • Alan
    Lv 7
    4 weeks ago

    It appears that 

    PREREQUISITE is expected to be an integer course number 

    it is probably the number 

    where PREREQUISITE  = 140 

    not the character string '140' .   

    You need to redefine your database if 

    you want PREREQUISITE to be a string 

    or create a 2nd variable for the character string title of the course.  

Still have questions? Get answers by asking now.