我正在将数据从旧数据库迁移到新数据库。这些列具有不同的数据类型。喜欢而不是浮点数,新数据库中有十进制数。 我的查询在下面,但是给出错误:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.js"></script>
<div ng-controller="DemoController" ng-app="demoApp">
<div>
<h2>Infinite Digest 2</h2>
<div ng-repeat="option in options">
<input type="button" value="+" ng-click="addQuery($index)" />
<input type="button" value="-" ng-click="removeQuery($index)" />
<select ng-model="option.level1" ng-options="lvl.name as lvl.name for lvl in level1options" ng-change="optionsLvLs = makeOptions(option.level1)"></select>
<select ng-model="option.level2" ng-options="opt.value as opt.label for opt in optionsLvLs"></select>
<br/>
<br/>
</div>
</div>
{{ options }}
</div>
有没有办法插入所有数据而没有任何问题
查询:
Arithmetic overflow error converting float to data type numeric.
数据类型:
OLDDB
insert into [newdb].[dbo].[newtab](State,StationID,AlertLevel,WarningLevel,DangerLevel,NormalLevel,UpperWaterLevel,LowerWaterLevel,WaterLevel_StationCode,RainFall_StationCode,OneHourRainfall,TwoHourRainFall,FourHourRainfall,TwantyFourHourRain,Lattitude,Longitude,District,RiverBasin,StationType)
Select State,Station_Name,ALERT,WARNING,DANGER,NORMAL,UPPER_WL,LOWER_WL,STID_WL,STID_RF,RF1HR,RF2HR,RF4HR,RF24HR,LATITUDE,LONGITUDE,DISTRICT,RIVER_BASSIN,StType from [olddb].[dbo].oldtab;
NEWDB
STATE varchar(50)
STATION_NAME varchar(50)
MMIID int
STATION_ID int
ALERT float
WARNING float
DANGER float
NORMAL float
MAX_WL float
MAIN_ID int
UPPER_WL float
LOWER_WL float
STID_WL int
STID_RF int
RF1HR float
RF2HR float
RF4HR float
RF24HR float
LATITUDE decimal(7, 6)
LONGITUDE decimal(9, 6)
REAL_NAME varchar(50)
DISTRICT varchar(50)
RIVER_BASSIN varchar(50)
position_wl int
station_status int
position_rf int
FULLNAME varchar(70)
station_update int
rainfall_name varchar(70)
TIMESTAMPS smalldatetime
Lembangan int
StType varchar(50)
答案 0 :(得分:2)
问题出现了,因为新数据库中的数据类型不够大。有两种方法可以解决这个问题: