Hello all,
The following SQL statement works in SQL Server Management Studio as a query on my server:
However, when I try to save it as a view, I get the following error:
"Object reference not set to an instance of an object."
Does anyone know what I could be doing wrong?
Thanks!
Kher
The following SQL statement works in SQL Server Management Studio as a query on my server:
Code:
select p.stateID, p.personID, hm.memberID, hm.startDate as householdMemberStartDate, hm.endDate as householdMemberEndDate, hm.secondary as householdMemberSecondary, hl.locationID, hl.startDate as householdLocationStartDate, hl.endDate as householdLocationEndDate, hl.secondary as householdLocationSecondary, hl.mailing as householdLocationMailing, hl.physical as householdLocationPhysical, a.addressID, a.number, a.street, a.tag, a.prefix, a.dir, a.apt, a.city, a.state, a.zip, a.postOfficeBox
from campus.Person p
inner join campus.Enrollment e on p.personID=e.personID
left join campus.HouseholdMember hm on p.personID=hm.personID
left join campus.Household hh on hm.householdID=hh.householdID
left join campus.HouseholdLocation hl on hm.householdID=hl.householdID
left join campus.Address a on hl.addressID=a.addressID
where e.calendarID=5160
However, when I try to save it as a view, I get the following error:
"Object reference not set to an instance of an object."
Does anyone know what I could be doing wrong?
Thanks!
Kher