求一sql语句

joco0713 2005-05-29 01:51:24
向数据库里插入多行数据怎么写
...全文
136 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hunter8888 2005-05-29
  • 打赏
  • 举报
回复
insert into yourtable (select yourfield from yourothertable)
或者
insert into yourtable (1,2,3,4)
(select 5 as 1,6 as 2,7 as 3,8 as 4 from yourothertable)
或者
insert into yourtable (1,2,3,4)
(select 5 as 1,6 as 2,7 as 3,8 as 4 from yourothertable
unoin
select 5 as 1,6 as 2,7 as 3,8 as 4 from yourothertable
unoin
select 5 as 1,6 as 2,7 as 3,8 as 4 from yourothertable
.......
)
看一看这些符合你的要求吗?

)

guolvguolv 2005-05-29
  • 打赏
  • 举报
回复
向数据库里插入多行数据怎么写???请说明白是插入相同的做测试用还是做什么用,楼上的是插入100行的存储过程
78hgdong 2005-05-29
  • 打赏
  • 举报
回复
循环插入100条记录:
declare @bb int
set @bb=1
while @bb<100
begin
insert into table1 values(@bb,....)
set @bb=@bb+1
end

2,495

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧