Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
除了连接之外,还有什么简单的方法可以从Linqpad 中查询INSERT结果的每一行创建单独的 SQL 语句?SELECT
INSERT
SELECT
这接近我想要的,但我认为它不接受 SQLSELECT字符串作为输入。
这也接近我想要的,但输出不是单独的INSERT语句。
您可以使用DumpAsInsert您的第一个建议。
DumpAsInsert
因为不止一次DumpAsInsert使用,你必须将查询实例化到内存中:IEnumerable
IEnumerable
var sel = this.ExecuteQuery<Accounts>(@"Select * from Accounts Where Actid < 100").ToList(); sel.DumpAsInsert("Accountscopy", "Actid");