当前位置:Gxlcms > 数据库问题 > Java调用BCP导入数据到数据库解决标识列ID问题

Java调用BCP导入数据到数据库解决标识列ID问题

时间:2021-07-01 10:21:17 帮助过:12人阅读

这个参数,即可解决标识列的问题!

下面是-E 参数的详细介绍,

-E   Specifies that identity value or values in the imported data file are to be used for the identity column. If -E is not given, the identity values for this column in the data file being imported are ignored, and SQL Server automatically assigns unique values based on the seed and increment values specified during table creation.    If the data file does not contain values for the identity column in the table or view, use a format file to specify that the identity column in the table or view should be skipped when importing data; SQL Server automatically assigns unique values for the column. For more information, see DBCC CHECKIDENT (Transact-SQL).   The -E option has a special permissions requirement. For more information, see "Remarks" later in this topic.

 

如果bcp导入的时候,没有加入-E这个参数,则对于目标表中的标识列的处理则由Sql Server 自动的来处理,因此得出的ID值就不是我们想要的了。

本文出自 “幽灵柯南的技术blog” 博客,请务必保留此出处http://enetq.blog.51cto.com/479739/912093


Java调用BCP导入数据到数据库解决标识列ID问题

标签:java 导入 bcp 标识列id

人气教程排行