26 lines
873 B
Markdown
Executable File
26 lines
873 B
Markdown
Executable File
```sql
|
|
declare @dt datetime --时间
|
|
declare @gpsindex numeric(18,2) --GPSIndex
|
|
declare @rand float --随机数
|
|
```
|
|
--declare @GPSINDEX1 bigint
|
|
```sql
|
|
declare @adatetime1 datetime
|
|
declare @endDate datetime; --结束时间
|
|
declare @X1 float
|
|
declare @Y1 float
|
|
declare @H1 float
|
|
declare @DX1 float
|
|
declare @DY1 float
|
|
declare @DH1 float
|
|
set @dt = GETDATE();
|
|
|
|
set @gpsindex = convert(bigint, datediff(ss, '1970-01-01 00:00:00', @dt))*1000 + datepart(ms,@dt) SET @DX1 = (rand()*-10 + 10)/4000
|
|
SET @DY1 = (rand()*-10 + 9)/4000
|
|
SET @DH1 =(rand()*-10 + 8)/4000
|
|
SET @X1 = 4877965.53002158+ @DX1
|
|
SET @Y1 = 537751.2022376+ @DY1
|
|
SET @H1 = 888.1181+ @DH1
|
|
SET @adatetime1 = DATEADD(S,@gpsindex/1000,'1970-01-01 00:00:00')
|
|
insert into HiMonitorDb.[dbo].plq_4_STC([GPSIndex],[aDatetime],[X],[Y],[Height],[dltaX],[dltaY],[dltaH])VALUES(@gpsindex,@adatetime1,@X1,@Y1,@H1,@DX1,@DY1,@DH1)
|
|
``` |