有lessonid这个字段 我想往里插入1到10 十行数据 用一条sql语句该怎么写?
解决方案 »
- 如何让Repeater横着显示数据 急
- JS中调用AJAX方法没反应
- 关于多表的插入问题。
- 有人做过自定义表单的项目么?我的思路,不知道对不对.请高手指教
- 请各位大侠进来指教关于XML的问题
- 请教在GridView里的Button怎么接受参数?
- 如何卸载2005重装2003?会不会有冲突?
- 对datagrid编辑状态时,textbox校验的超难问题!!!这种校验难道实现不了???
- 在asp.net中用multipage+tabstrip中,转换页面时,更新相应的数据!急!
- ASP.net的VB.net和以往的VBScript详细区别在哪里?为什么现在的教材都是用C#来写ASP.net
- gridview的 模版页问题
- 内置对象
select 1
union all
select 2
...
select 10
declare @i int
set @i=0
while @i<10
begin
insert into 表(字段)values(数值)
set @i=@i+1
end
更新是通过DataAdapter对象的Update()方法进行的。
在DataSet对象的DataTable之DataRow对象进行多次NewRow后,再AddRow,再DataAdapter.Update(),系统将自动对更改(含增加)的内容进行识别并更新到数据库
select 1
union all
select 2
...
select 10
DECLARE @MyCounter INT SET @MyCounter = 0 /*设置变量*/ WHILE (@MyCounter < 20) /*设置循环次数*/ BEGIN WAITFOR DELAY '000:00:10' /*延迟时间10秒*/ INSERT INTO T_yali (title) select title from t_news
SET @MyCounter = @MyCounter + 1 END
CREATE PROCEDURE insert_date
DECLARE @MyCounter INT
AS
BEGIN
SET @MyCounter = 0
WHILE (@MyCounter < 20) BEGIN WAITFOR DELAY '000:00:10'
INSERT INTO T_yali (title) select title from t_news
SET @MyCounter = @MyCounter + 1 END END
在该需求下,循环就可以了。
-----------------------------------------------------------
http://www.shenjk.com