本文介紹了在 T-Sql 插入語句中使用 Row Constructor 語法有什么好處?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
在 SQL Server 2008 中,您可以使用 Row Constructor 語法通過單個插入語句插入多行,例如:
In SQL Server 2008, you can use the Row Constructor syntax to insert multiple rows with a single insert statement, e.g.:
insert into MyTable (Col1, Col2) values
('c1v', 0),
('c2v', 1),
('c3v', 2);
除了可讀性之外,這樣做比為每條記錄使用一個插入語句有什么好處嗎?
Are there benefits to doing this instead of having one insert statement for each record other than readability?
推薦答案
是的 - 您將看到性能改進.尤其是在記錄大量的情況下.
Yes - you will see performance improvements. Especially with large numbers of records.
這篇關于在 T-Sql 插入語句中使用 Row Constructor 語法有什么好處?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!