SQL Server for循环
insertintocms_countvalues('192.168.1.174','1','狗狗','http://gougou.com/','1280*780','I...
insert into cms_count values('192.168.1.174','1','狗狗','http://gougou.com/','1280*780','IE','Vasta','www.163.com','2007-12-12')
时间要更改
我要循环插入。插到.2008-9-10 . 是
在SQL查询分析器里面怎么插入 展开
时间要更改
我要循环插入。插到.2008-9-10 . 是
在SQL查询分析器里面怎么插入 展开
1个回答
展开全部
你是每天插一条这样的数据吗
declare @num int
declare @datediff int
select @datediff=datediff(day,'2007-12-12','2008-9-10)
set @num=0
while @num<@datediff
begin
insert into cms_count values('192.168.1.174','1','狗狗','http://gougou.com/','1280*780','IE','Vasta','www.163.com',dateadd(day,@num,'2007-12-12') )
set @num=@num+1
end
declare @num int
declare @datediff int
select @datediff=datediff(day,'2007-12-12','2008-9-10)
set @num=0
while @num<@datediff
begin
insert into cms_count values('192.168.1.174','1','狗狗','http://gougou.com/','1280*780','IE','Vasta','www.163.com',dateadd(day,@num,'2007-12-12') )
set @num=@num+1
end
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询