用sql语句创建一个全是三十六进制数的表,要求从001到zzz

解决方案 »

  1.   

    是这个表某列的内容从001到zzz?
      

  2.   

    select rtrim(char(number+48)) a into #tb from dbo.spt_values where type='P' and number<10
    union all
    select char(number+97) from dbo.spt_values where type='p' and number<26select a.a+b.a+c.a from #tb a,#tb b,#tb c where ascii(c.a)>48
    order by 1drop table #tb/*
    ----
    001
    002
    003
    004
    005
    006
    ....
    zzw
    zzx
    zzy
    zzz(45360 row(s) affected)
      

  3.   

    修改select rtrim(char(number+48)) a into #tb from dbo.spt_values where type='P' and number<10
    union all
    select char(number+97) from dbo.spt_values where type='p' and number<26select a.a+b.a+c.a from #tb a,#tb b,#tb c where a.a+b.a+c.a>'000'
    order by 1drop table #tb/*
    ----
    001
    002
    003
    004
    005
    006
    ....
    zzw
    zzx
    zzy
    zzz(46655 row(s) affected)
      

  4.   

    select * into table1.int_id from table2.id,table1和table2分别在两个数据库中,现在table2数据库名称中有.,现在这句sql总是报错,说。附近有语法错误,请问有什么解决办法吗