if not exists(select * from syscolumns where id=object_id(‘REMOTEDETECTION_2018‘))
begin SELECT * INTO REMOTEDETECTION_2018 FROM REMOTEDETECTION where 1=0 end;
insert into RemoteDetections(DETECTIONSTATE,PASSDATETIME,VLPN,VLPNCOLOR,FUELTYPE,BZTYPE,VEHICLETYPE,RECENTSTATION,CO,CO2,NO,HC,VSP,SPEED,ACCELERATION,CONFIDENCE,WINDSPEED,WINDDIRECTION,
TEMPERATURE,IMPORTDATE,IUVTYPE,OWNERNAME,City_ID,Station_ID,REMOTEDETECTIONCODE,NH3,SF,IMAGEPATH,IMAGE,humidity,atmosphere,Highemissions,IsValid,Islocal,StationCode,CarColor,CarType,
Image1Name,Image1Path,Image2Name,Image2Path,VideoName,VideoPath,VehicleID)
select DETECTIONSTATE,PASSDATETIME,VLPN,VLPNCOLOR,FUELTYPE,BZTYPE,VEHICLETYPE,RECENTSTATION,CO,CO2,NO,HC,VSP,SPEED,ACCELERATION,CONFIDENCE,WINDSPEED,WINDDIRECTION,
TEMPERATURE,IMPORTDATE,IUVTYPE,OWNERNAME,City_ID,Station_ID,REMOTEDETECTIONCODE,NH3,SF,IMAGEPATH,IMAGE,humidity,atmosphere,Highemissions,IsValid,Islocal,StationCode,CarColor,CarType,
Image1Name,Image1Path,Image2Name,Image2Path,VideoName,VideoPath,VehicleID from RemoteDetection where PASSDATETIME>=‘2018-10-08 00:00:00‘ and PASSDATETIME<=‘2018-10-08 23:59:59‘;
原文地址:https://www.cnblogs.com/luoguixin/p/9777105.html