Viewing 15 posts - 26,446 through 26,460 (of 26,490 total)
After wrestling with it some more, I have come up with a viable solution using a derived table and
a cross join. Please take a close look at the query to...
July 18, 2006 at 3:13 pm
I have made some updates to my test code:
set nocount on
create table dbo.SchoolAttendance(
AttendanceRuID int,
StudentID int,
AttendanceDate datetime,
AttendanceTyID int,
RollupCount int,
termID int null
)
create table dbo.SchoolAttendanceTy (
AttendanceTyID...
July 18, 2006 at 2:28 pm
Actually, not. In your code, you have hardcoded the student id.
your code:
select sat.AttendanceTyID
, sat.Description
, sar.AttendanceRuID
, 169 StudentID
, sar.AttendanceDate
, isnull(sar.RollupCount,0) RollupCount
from SchoolAttendanceTy sat
left join...
July 18, 2006 at 2:25 pm
Here is an update of what I have done:
set nocount on
create table dbo.SchoolAttendance(
AttendanceRuID int,
StudentID int,
AttendanceDate datetime,
AttendanceTyID int,
RollupCount int,
termID int null
)
create table dbo.SchoolAttendanceTy (
AttendanceTyID...
July 18, 2006 at 2:09 pm
I'm sorry, but I don't see how your code solves the problem. You still have a condition in the where clause checking for StudentID = 169. The table SchoolAttendanceTy does...
July 18, 2006 at 2:03 pm
stax68,
Everything I used is in my big post. Add where sa.StudentID = 169 to the where clause and you will reduce the result set displayed in my post by 1...
July 18, 2006 at 1:44 pm
I just figured out the problem. Your where clause contains sar.studentID = 169.
The line with AttendanceTyID = 2 is null in the column, and fails the where condition.
Change it to...
July 18, 2006 at 1:30 pm
I took what you posted (I don't see CompanyID anywhere, so I left it off) and did the following:
set nocount on
create table dbo.SchoolAttendance(
AttendanceRuID int,
StudentID int,
AttendanceDate datetime,
AttendanceTyID...
July 18, 2006 at 1:19 pm
Please try dropping the termId is null from the where clause using the query stax68 gave you. What does that return?
Lynn
July 18, 2006 at 10:57 am
Colin,
Try the following, you will see that the table variable still has data after the rollback.
This can only mean that the insert to the table var inside the begin transaction...
July 18, 2006 at 9:40 am
Looks like this job is part of a maintenacne plan. Do delete it, you will probably need to modify the plan.
![]()
July 18, 2006 at 9:27 am
Not sure, but if you deny the SA or Sys Admin from view database objects (databases, tables, etc), doesn't that mean you don't need a Sys Admin or SA? A...
July 18, 2006 at 9:26 am
First problem, SchoolAttendanceType is on the right, not left. Try a right outer join. You may also want to drop the termId is null in the where clause.
hth,
Lynn
July 18, 2006 at 9:18 am
table vars are also faster as inserts/deletes/updates to table vars are not logged.
Lynn
July 17, 2006 at 4:21 pm
It looks like you wanted a Windows collation during installation, but selected a SQL collation instead. I can not find any windows collations that look like this: latin1_general_CP1_CI_AS. The CP...
July 17, 2006 at 2:15 pm
Viewing 15 posts - 26,446 through 26,460 (of 26,490 total)