在处理SSM中的自动增量列时,如何将数据从Excel导入到底部的现有表中?
我在SSM(SQL Server Management Studio)中有一个现有表。
susident_table
UID | ID | Name | Location |
-----+------+---------+-----------+
1 1 Jogn US
2 2 Alia UK
在UID中是自动增量和ID,名称,位置是我的数据列,
因此我有一个excel,其中包含以下数据:
ID | Name | Location |
----+---------+-----------+
3 Jk Santa
4 Lima PS
现在,上面的两个列应添加到上述现有susidents_table 在SQL Server中,但是现在如何处理自动增量列?
我是否想在我的Excel中添加该列,并考虑下一个增量数字来导入?
I have an existing table like below in SSMS (SQL Server Management Studio).
Students_Table
UID | ID | Name | Location |
-----+------+---------+-----------+
1 1 Jogn US
2 2 Alia UK
where in UID is an auto increment and ID,Name,Location are my data columns
So I have an excel with data like below:
ID | Name | Location |
----+---------+-----------+
3 Jk Santa
4 Lima PS
Now the above two columns should be added to the bottom of the above existing Students_Table
in SQL Server, but how to handle the auto increment column now?
Am I suppose to add the that column in my excel and import by considering the next incremented number?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要能够将数据从Excel复制和粘贴到SQL Server,您必须在Excel中包含一个空列(uid)列:
您可以查看我的博客文章擅长于SQL Server以获取更多详细信息。 <具有身份列时,带有屏幕截图的分步说明。
To be able to copy and paste the data from Excel to SQL Server, you will have to include an empty column in Excel for the identity (UID) column:
You can check out my blog article that describes how to copy data from Excel to SQL Server for further details. Section 2b includes a step-by-step instruction with screenshots for your case when having an identity column.