如何在单行的 table 中插入多行?

How to insert multiple rows in a table with single row?

我有一个 table 试图将多行插入到单个列中...有什么简单的方法可以做到这一点吗?

insert into tableA
(name) values(
'A',
'B',
'C',
.,
.,

我有大约 400 行 我从 excel sheet 中获取名称 我尝试使用 import from excel 但这没有用,因为它抛出了一个错误说格式错误。

任何类型的想法表示赞赏 谢谢

Yes(假设您使用的是 SQL Server 2008 或更新版本并且每行不超过 1000 列)。

您可以通过用逗号分隔值块来插入具有相同架构的行。

INSERT INTO tableA (name)
VALUES ('A'), ('B'), ('C')...

您目前的做法是尝试将每一行添加为一列。