# 请问以下SQL程序有何错误

Posted by 孤帆 on October 13, 1998 at 14:28:48:

CREATE PROCEDURE UPDATE_TDUTYRCD
(@d1 char(7),@d2 char(5),@d3 char(5))
AS
select employee,sum(hour88) as hour
into #tday
from t_transduty
where convert(char(8),date,112) like @d1
and type = '5'
group by employee
select t_dutyrcd.employee,(already + hour) as aa
into #tday2
from t_dutyrcd join #tday on t_dutyrcd.employee=#tday.employee
where date=@d2
update t_dutyrcd set already=aa
where t_dutyrcd.employee=#tday2.employee
and t_dutyrcd.date=@d3
RETURN

GO

错误讯息如下:
ERROR 107:[SQL Server] The coiumn prefix '#tday2' does not match
with a table name or alias name used in the query.

Follow Ups:

- Re: 请问以下SQL程序有何错误 大头 16:54:32 10/13/98 (0)