打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
sql循环插入
declare @TrackerNumber varchar(15)
declare @Date datetime
declare @Latitude float
declare @Longitude float
declare @Speed float
declare @Direction int
DECLARE temp2 CURSOR FOR 
    SELECT cast(TrackerNumber as varchar(15)),Date,cast(Latitude as float),cast(Longitude as float),cast(Speed as float),Direction FROM imei353327020471926
OPEN temp2; 
--得到一行数据,并将其复制给本地变
FETCH FROM temp2 INTO @TrackerNumber, @Date,@Latitude,@Longitude,@Speed,@Direction;
insert into GpsTrackerData(Gps_Imei,Gps_Datatime,Gps_Latitude,Gps_Longitude,Gps_Speed,Gps_Direction) values(@TrackerNumber, @Date,@Latitude,@Longitude,@Speed,@Direction);
--SQLSTATE 00000: 操作执行成功并且未产生任何类型的警告或异常情况。
--通过这个可以检查是否到达最后一行
while @@FETCH_STATUS=0
begin
FETCH FROM temp2 INTO @TrackerNumber, @Date,@Latitude,@Longitude,@Speed,@Direction;   --在WHILE逻辑中得到更多的行数据
insert into GpsTrackerData(Gps_Imei,Gps_Datatime,Gps_Latitude,Gps_Longitude,Gps_Speed,Gps_Direction) values(@TrackerNumber, @Date,@Latitude,@Longitude,@Speed,@Direction);
end
close temp2
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
[转载]通过GPS信息获取当前所在城市名的代码
javascript通过json2.js处理json格式数据
google earth com api 中IApplicationGE 接口SetCam...
world wind 学习
深入浅出Symfony2
android map:convert string to geopoint
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服