sql-server - 将(sql)数据类型varchar转换为float时出错...但没有什么是float
问题描述
我有一个存储过程,其中没有任何源,也没有任何目标,也没有任何参与将内容连接到源中的列,列的数据类型为 float。但是当我尝试运行它时,我得到了
将数据类型 varchar 转换为浮点数时出错。
我浏览了源代码中引用的每一列,并注释掉试图找出它试图转换的东西,但它似乎总是给出相同的信息。
据我所知,我的专栏都是varchar(255)
or 。int
with temp_mart as (
select
ca.YearMonth as Date,
s.ID as SurveyID,
t.TeamName as Team,
q.MetricID,
-- cast(C.City as varchar(255)) as City,
r.Role,
QR.QuestionID,
QR.ID as QuestionResponseID,
QR.Rating,
QR.OpenResponse,
QT.ID as QuestionTypeID
from QuestionResponses QR
join lkup.Questions Q on Q.QuestionID=QR.QuestionID
join lkup.Teams T on t.id=Q.TeamID
join lkup.Surveys S on s.id=q.SurveyID
join lkup.Calendar ca on ca.id=s.ValidFromID
join Responses RE on RE.Qualtrics_ID=QR.Qualtrics_ID
join lkup.Roles R on r.id=re.roleID
join lkup.Cities C on c.id=re.cityID
join lkup.QuestionType QT on QT.ID=Q.QuestionTypeID
where (select count(cityid) from responses) > 3
)
merge DataMart as target
using temp_mart as source
on (source.QuestionResponseID = target.QuestionResponseID)
when matched then update
set
target.Rating=source.Rating,
target.OpenResponse=source.OpenResponse
when not matched by target
then insert (
Date,
SurveyID,
Team,
MetricID,
-- City
Role,
QuestionID,
QuestionResponseID,
Rating,
OpenResponse,
QuestionTypeID)
values (
source.Date,
source.SurveyID,
source.Team,
source.MetricID,
--source.City,
source.Role,
source.QuestionID,
source.QuestionResponseID,
source.Rating,
source.OpenResponse,
source.QuestionTypeID)
解决方案
推荐阅读
- tensorflow - 您将使用哪种模型(GPT2、BERT、XLNet 等)进行文本分类任务?为什么?
- python - 如何将 ListedColorMap 转换为颜色列表?
- ios - 具有动态高度的单元格的手风琴式动画的 UITableView
- reactjs - 映射路由器的属性数组时要指定什么类型?
- c++ - 如何发送通过绑定到函数/方法创建的功能对象?
- c++ - int main() 中的内存限制
- sql - 如何按一个字段过滤唯一值?
- java - Android WorkManager:无法从 PeriodicWorkRequest 获取输出数据
- r - 如何根据其他列的字符值创建第三列,不包括 NA 和值?
- algorithm - 将十六进制数转换为十进制形式的最快算法,无需使用固定长度变量来存储结果