The following view belongs to sa and lives in a Db called DC. SELECT * FROM DC..COMP_TIME_LOST_V works fine for sa but
not for userx. userx has select access to the underlying tables and the view. userx also has access to the PROD and DC Dbs. In query Analyzer userx executes the above select and waits forever for results. If userx attempts to display the columns of the view using the object browser the +/- box disappears from the browser. Note also, that userx can execute the SELECT part of this create view statement just fine. Thanks for your help. Chris.
create view Comp_Time_Lost_V as
select j.home_department hd,
d.descr hdd,
j.home_department+' '+replace(d.descr,'-REG','') hddd,
w.empno emplid,
w.fname fname,
isnull(w.cmp_bal,0) prior_bal,
(isnull(w.ce15,0) + isnull(w.ce10,0)) earned,
isnull(w.cmp_hrs,0) taken,
isnull(w.cmp_bal,0) - isnull(w.cmp_hrs,0) +
isnull(w.ce15,0) + isnull(w.ce10,0) new_bal,
isnull(w.ce_lim,0) limit,
case
when isnull(w.ce_lim,0) - (isnull(w.cmp_bal,0) -
isnull(w.cmp_hrs,0) + (1.5*isnull(w.ce15,0)) + isnull(w.ce10,0)) < 0
then abs(isnull(w.ce_lim,0) - (isnull(w.cmp_bal,0) -
isnull(w.cmp_hrs,0) + (1.5*isnull(w.ce15,0)) + isnull(w.ce10,0)))
else 0
end lost
from dc..wsdata w,
prod..ps_job j,
prod..ps_al_dept_tbl d
where isnull(w.ce_lim,0) != 0
and j.emplid = w.empno
and d.department_nbr = j.home_department
and j.effdt = (select max(a.effdt)
from prod..ps_job a
where a.emplid = j.emplid)
and j.effseq = (select max(b.effseq)
from prod..ps_job b
where b.emplid = j.emplid
and b.effdt = j.effdt)
not for userx. userx has select access to the underlying tables and the view. userx also has access to the PROD and DC Dbs. In query Analyzer userx executes the above select and waits forever for results. If userx attempts to display the columns of the view using the object browser the +/- box disappears from the browser. Note also, that userx can execute the SELECT part of this create view statement just fine. Thanks for your help. Chris.
create view Comp_Time_Lost_V as
select j.home_department hd,
d.descr hdd,
j.home_department+' '+replace(d.descr,'-REG','') hddd,
w.empno emplid,
w.fname fname,
isnull(w.cmp_bal,0) prior_bal,
(isnull(w.ce15,0) + isnull(w.ce10,0)) earned,
isnull(w.cmp_hrs,0) taken,
isnull(w.cmp_bal,0) - isnull(w.cmp_hrs,0) +
isnull(w.ce15,0) + isnull(w.ce10,0) new_bal,
isnull(w.ce_lim,0) limit,
case
when isnull(w.ce_lim,0) - (isnull(w.cmp_bal,0) -
isnull(w.cmp_hrs,0) + (1.5*isnull(w.ce15,0)) + isnull(w.ce10,0)) < 0
then abs(isnull(w.ce_lim,0) - (isnull(w.cmp_bal,0) -
isnull(w.cmp_hrs,0) + (1.5*isnull(w.ce15,0)) + isnull(w.ce10,0)))
else 0
end lost
from dc..wsdata w,
prod..ps_job j,
prod..ps_al_dept_tbl d
where isnull(w.ce_lim,0) != 0
and j.emplid = w.empno
and d.department_nbr = j.home_department
and j.effdt = (select max(a.effdt)
from prod..ps_job a
where a.emplid = j.emplid)
and j.effseq = (select max(b.effseq)
from prod..ps_job b
where b.emplid = j.emplid
and b.effdt = j.effdt)