加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

缺少对象或列名,或者对象或列名为空。

发布时间:2020-12-12 14:13:04 所属栏目:MsSql教程 来源:网络整理
导读:Sql Server错误 缺少对象或列名,或者对象或列名为空。对于 SELECT INTO 语句,请确保每列均具有名称。对于其他语句,请查找空的别名。不允许使用定义为 "" 或 [] 的别名。请将别名更改为有效名称。 http://technet.microsoft.com/zh-CN/library/cc645860 错

Sql Server错误

缺少对象或列名,或者对象或列名为空。对于 SELECT INTO 语句,请确保每列均具有名称。对于其他语句,请查找空的别名。不允许使用定义为 "" 或 [] 的别名。请将别名更改为有效名称。

http://technet.microsoft.com/zh-CN/library/cc645860

错误:Insert Into UT_PrePaid
?Select
?Year(PayDate),
?Month(PayDate),
?FK_SDDealer,
?Balance,
?1,
?@FK_User,
?Getdate(),
?Getdate()??From #tempValid

修改:

Insert Into UT_PrePaid
?Select
?Year(PayDate) As Years,
?Month(PayDate) As Months,
?1 As IsValid,
?@FK_User As CreateUser,
?@FK_User As ModifyUser,
?Getdate() As CreateTime,
?Getdate() As ModifyTime
?From #tempValid

错误原因? select into 每一列都要有列名

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读