如何用sql server中的单个命令填充所有行的示例 [英] how to fill all row in single command in sql server with example
本文介绍了如何用sql server中的单个命令填充所有行的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设该行中的行数在单个命令中的所有数据相同plz回复示例。
紧急删除 - OriginalGriff [/ edit]
解决方案
你可以用while循环做一些时髦的事情:
声明 @ count int
声明 @ maxrows int
set @ count = 0
set @ maxrows = 1000
while @ count < @ maxrows
begin
INSERT INTO table (FIELD1 ... FIELDn) VALUES (VALUE1 ... VALUEn)
set @ count = < span class =code-sdkkeyword> @ count + 1
end
suppose number of row in that row all data are same in single command plz reply with example.
[edit]Urgency deleted - OriginalGriff[/edit]
解决方案
You can do something snazzy with a while loop:
declare @count int declare @maxrows int set @count = 0 set @maxrows = 1000 while @count < @maxrows begin INSERT INTO table (FIELD1...FIELDn) VALUES (VALUE1...VALUEn) set @count = @count + 1 end
这篇关于如何用sql server中的单个命令填充所有行的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文