当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 如何将access的数据在java程序中导入或创建excel ......
 ·sql语句的问题    »显示摘要«
    摘要: 好久没用vb了,今天写个小程序,出先了问题 sconn = "provider=microsoft.jet.oledb.4.0;data source=" & app.path & "\dbcomm.mdb;mode=readwrite|share deny none;persist security info=false" scon......


如何一次插入多条新记录

现在已经建好表,还没有记录,想写进9条记录的数据进而是100多条,只写第一列,值有规律:  
  第一列                                              
  20030925000001                    
  20030925000002  
  ...  
  20030925000009  
  ...  
  20030925000010  
  20030925000011  
  ...  
  20030925000128  
  ...  
   
  请问SQL   Server里如何实现?  
 

NO.1   作者: letsflytogether

declare   @i   int  
  set   @i=1000  
  while   @i>1  
  begin    
  insert   into   表   values(convert(char(8),getdate(),112)+right(000000+cast(1000-@i+1   as   varchar(6)))  
  end

NO.2   作者: sdhdy

declare   @a   int  
  set   @a=1  
  while   @a<=10000--你要加的最大数  
  begin  
  insert   tablename(co1)   select   20030925+right(000000+cast(@a   as   varchar),6)  
  set   @a=@a+1  
  end  
 

NO.3   作者: aierong

 
   
   
  create   table   ai   (   i   varchar(1000))  
   
  declare   @n   smallint,@m   varchar(100)  
  select   @n=1  
  while   @n<你的上限  
  begin  
  select   @m=convert(varchar(100),@n)  
  select   @m=(case   when   len(@m)=1   then   00000  
  when   len(@m)=2   then   0000  
  when   len(@m)=3   then   000  
          end)+@m  
  insert   into   ai   select   convert(char(8),getdate(),112)+@m  
  select   @n=@n+1  
  end  
   
  20030925000001                    
  20030925000002  
  ...  
  20030925000009  
  ...  
  20030925000010  
  20030925000011  
  ...  
  20030925000128  
  ...  
 


    摘要: 我是通过下面的这些步骤来通过pull模式来执行水晶报表的 1.首先创建rpt文件,并使用水晶报表设计接口设置一些必须的数据连接。 2.拖放一个 crystalreportviewer控件至aspx页面,设置它的属性指定我们上一步创建的.rpt 文件。 3. 在代码中调用databind方法。 创建 .rpt 文件: 1) 在右击”解决方案游览器“,在弹出的菜单中选择”添加“--”添加新项“......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE