简体   繁体   English

不允许从数据类型datetime到int的隐式转换错误。 使用CONVERT函数运行此查询

[英]Error of Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query

I have table of stock with DOCDate field and it has datatype as datetime, when i am running my query, it shows me error 我有带有DOCDate字段的库存表,并且数据类型为datetime,当我运行查询时,它向我显示错误

'Implicit conversion from data type datetime to int is not allowed. '不允许从数据类型datetime到int的隐式转换。 Use the CONVERT function to run this query.' 使用CONVERT函数运行此查询。”

My query is 我的查询是

insert into SSPERPStock (LinkID, DocNo, DocDate, VoucherType, ProductID, Weight, AL, InEdit, CreatedU‌​serId) 
values (IDENT_CURRENT('SSPERPDailyInkConsumptionTransaction'),'DOC1001','2013-02-‌​14','ICPacked',8,5,'L',0,GETDATE())

What can be the solution of this mistry?? 这个迷茫的解决办法是什么?

You are trying to add a date ( GETDATE() ) to your column CreatedU‌​serId 您正在尝试将日期( GETDATE() )添加到列CreatedU‌​serId

insert into SSPERPStock (... , CreatedU‌​serId) 
values (... , GETDATE())

which is probably an int and not what you wanted to do in the first place. 这可能是一个int而不是您最初想要做的。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dapper:不允许从数据类型 datetime 到 int 的隐式转换。 使用 CONVERT function 运行此查询 - Dapper: Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query 回滚迁移错误不允许从数据类型datetime到int的隐式转换。 使用CONVERT函数运行此查询 - Roll Back Migration Error Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query 错误:不允许从数据类型varchar到varbinary(max)的隐式转换。 使用CONVERT函数运行此查询 - Error : Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query 不允许从数据类型nvarchar到二进制的隐式转换。 使用CONVERT函数运行此查询。 - Implicit conversion from data type nvarchar to binary is not allowed. Use the CONVERT function to run this query. 不允许从数据类型sql_variant隐式转换为varbinary(max)。 使用CONVERT函数运行此查询。 ASP.NET SQL数据源 - Implicit conversion from data type sql_variant to varbinary(max) is not allowed. Use the CONVERT function to run this query. ASP.NET SQL DataSource System.Data.SqlClient.SqlException:不允许从数据类型sql_variant到uniqueidentifier的隐式转换。 - System.Data.SqlClient.SqlException: Implicit conversion from data type sql_variant to uniqueidentifier is not allowed. 如何处理异常不允许从数据类型varchar隐式转换为varbinary(max)。 在将数据添加到数据库时 - how to handle the exception Implicit conversion from data type varchar to varbinary(max) is not allowed. while adding the data to database 使用EF6存储数据时出现“不允许从数据类型nvarchar(max)到varbinary的隐式转换”错误 - “Implicit conversion from data type nvarchar(max) to varbinary is not allowed” error when storing data using EF6 不允许从数据类型nvarchar隐式转换为varbinary(max) - Implicit conversion from data type nvarchar to varbinary(max) is not allowed 不允许从数据类型 sql_variant 隐式转换为 varchar - Implicit conversion from data type sql_variant to varchar is not allowed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM