写一个触发器。从tb_control里删除一条记录,自动把该记录添加到另一个表tb_ctrlHistor中create TRIGGER save_historyON tb_control FOR delete AS IF @@ROWCOUNT>0 BEGIN INSERT tb_ctrlHistor SELECT column_name_1,column_name_12 FROM deletedEND 写一个SQL 语句,可以在查询分析器里执行。 循环5次写入tb_test,字段id,name,num; id为自动编号,name为1,num从1到5create table for_test(a varchar(50))declare @i intset @i=1while(@i<=5)begininsert into for_test values(cast(@i as varchar(50)))set @i=@i+1 end 转载于:https://www.cnblogs.com/askyes/archive/2007/09/06/883925.html