高分求存储过程语句,难~
AS
begin
--定义当前整点时间变量
declare @nowtime as varchar(20)
select @nowtime =( dateadd(hh,convert(int,convert(varchar(2),getdate(),8)),convert(datetime,convert(varchar,getdate(),112))))
--清空weatemp表
TRUNCATE TABLE weatemp
--开始插入每个表当前整点数据数据
insert into weatemp
select stationname as 自动站名称 ,
OutsideTemp as 气温 ,
barameter as 气压 ,
mainWinddir as 风向 ,
windspeed as 风速 ,
Rain as 雨量 ,
OutsideHum as 湿度
from ze007record
where rstime =@nowtime
..............
insert into weatemp
select stationname as 自动站名称 ,
OutsideTemp as 气温 ,
barameter as 气压 ,
mainWinddir as 风向 ,
windspeed as 风速 ,
Rain as 雨量 ,
OutsideHum as 湿度
from ze021record
where rstime =@nowtime
现在遇到个问题,就是当某个自动站坏了之后,也就是表中查不到
rstime 等于当前时间的记录,如何向weatemp 表中 插入
自动站名称 =***自动站 ,气温,气压等其他值为"/"呢
ze007record 自动站的表 stationname是varchar类型,都为预设值(如***自动站),其他列都为float 和int类型
weatemp 表中的数据类型我都是varchar
这个存储过程 语句怎么写呢? 救命啊~