Hello, I have an append query in my access, that is linked with sql server 2005.

I want to use an append query that I maked in access, i want to use it in sql server so it can append the records to a specific table.
My query is as follow:

INSERT INTO Marks ( Student_Id, Course_Id, Grupo_Id )
SELECT Attendance.Student_Id, Course.Course_Id, Attendance.Grupo_Id
FROM Grupo_Section INNER JOIN (Course INNER JOIN ((Grupo INNER JOIN Attendance ON Grupo.Grupo_Id = Attendance.Grupo_Id) INNER JOIN Student ON Attendance.Student_Id = Student.Student_Id) ON Course.Course_Id = Grupo.Course_Id) ON (Grupo_Section.Grupo_Date = Attendance.Grupo_Date) AND (Grupo_Section.Grupo_Id = Attendance.Grupo_Id) AND (Grupo_Section.Grupo_Id = Grupo.Grupo_Id)
GROUP BY Attendance.Student_Id, Course.Course_Id, Attendance.Grupo_Id, Attendance.Grupo_Id, Course.Course_Levelid, Attendance.Attend
HAVING (((Course.Course_Levelid)="N1") AND ((Attendance.Attend)=-1) AND ((Count(Attendance.Attend))=1)) OR (((Course.Course_Levelid)="N2") AND ((Attendance.Attend)=-1) AND ((Count(Attendance.Attend))>=3));

How can use this in sql server 2005?

Recommended Answers

All 3 Replies

It looks like you can just run it as-is. Have you tried?

It looks like you can just run it as-is. Have you tried?

Yes I have tried it and it gives me this error message;
Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.Grupo_Student'.
And it refers to the INSERT INTO dbo.Marks statement

Well that means the table doesn't exist. Does the table exist as a user object and not as dbo.TableName?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.