在处理SSM中的自动增量列时,如何将数据从Excel导入到底部的现有表中?

发布于 2025-01-29 13:41:20 字数 541 浏览 2 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

☆獨立☆ 2025-02-05 13:41:20

要能够将数据从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:

enter image description here

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文