从数据类型varbinary到日期SQL服务器的隐式转换(Implicit conversion from data type varbinary to date SQL server)

编程入门 行业动态 更新时间:2024-10-28 16:18:05
数据类型varbinary到日期SQL服务器的隐式转换(Implicit conversion from data type varbinary to date SQL server)

我有一个过程,它将date值作为参数,然后在表中插入日期值:

CREATE PROCEDURE dbo.procInsert @employed_on DATE AS BEGIN INSERT INTO dbo.TBL(EMPLOYED_ON) VALUES(@employed_on) END

但是我收到这个错误:

不允许从数据类型varbinary到日期的隐式转换。 使用CONVERT函数运行此查询。

我试图使用convert但它不工作。

更新我发现了我的错误。 我把变量换成了插入。

I have a procedure which takes a date value as parameter and then inserts the date value in a table:

CREATE PROCEDURE dbo.procInsert @employed_on DATE AS BEGIN INSERT INTO dbo.TBL(EMPLOYED_ON) VALUES(@employed_on) END

however i am getting this error:

Implicit conversion from data type varbinary to date is not allowed. Use the CONVERT function to run this query.

I tried to use convert but its not working.

UPDATE i found my mistake. i swapped the variables for insert.

最满意答案

我发现了我的错误。 我把变量换成了插入。

i found my mistake. i swapped the variables for insert.

更多推荐

本文发布于:2023-07-15 15:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1115276.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据类型   日期   服务器   隐式   date

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!