INSERT A ROW IN TABLE FROM MULTIBLE TABLES. SQL SERVER 2008

Friends.. .  I want to insert the row in the RTABLE( studentid, studentname , studentphoto).

STABLE have a  studentphoto values , and DTABLE have a studentname

I want to insert the RTABLE values from STABLE values and DTABLE values.

Is this possible ? how.. .

March 28th, 2015 6:14am

Could you try below query?  (Assuming you have StudentID in each table)

INSERT INTO RTable
SELECT STable.StudentID, 
    STable.StudentPhoto, 
    DTable.StudentName
FROM STable
INNER JOIN DTable
ON STable.StudentID = DTable.StudentID

Free Windows Admin Tool Kit Click here and download it now
March 28th, 2015 6:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics