And*_*ili 1 sql database sql-server rdbms
我是SQL Server和DBMS的新手,我在以下查询中遇到了一些问题:查询名为:MaliciousCodeAlertDocument的表的单个记录
这是我的查询:
UPDATE MaliciousCodeAlertDocument
SET Discovered = GetDate(),
LastUpdated = GetDate(),
SourceId = "UP",
MalCodeID = 1,
Title = "UPDATED",
Origin = "UP",
Type = "UP",
Feature = "UP",
Risk = "UP",
Severity = 1,
OverallImpact = 1,
ContagionPotential = 1,
Wild = "UP",
AlertStatusID = 1,
AttributeType = 1,
DetailLevel = 1 ,
Language = 1 ,
Summary = "UP" ,
Symptom = "UP" ,
TechnicalDescription = "UP" ,
MitigatingStrategy = "UP" ,
Disinfection = "UP" ,
URL = "UP"
WHERE Id = 11316
Run Code Online (Sandbox Code Playgroud)
当我尝试执行它时,我获得以下错误消息:
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UPDATED'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Msg 207, Level 16, State 1, Line 1
Invalid column name 'UP'.
Run Code Online (Sandbox Code Playgroud)
问题是什么?我该如何解决?
TNX
使用双引号使SQL Server认为引号中的值是一列,但看起来您正试图将其更新为文本值.如果您使用单引号,SQL将识别您要将该值插入到字段中,并应正确加载它.
编辑:对不起,没看到@scragar已经发布了这个解决方案.任何人都知道我是否应该删除我的答案?
| 归档时间: |
|
| 查看次数: |
672 次 |
| 最近记录: |