http://expert.csdn.net/Expert/topic/2437/2437014.xml?temp=.67857
交流]自增号

解决方案 »

  1.   

    select indentity(int,1,1) as id,* into #t form tablename
    select * from #t
    go
    drop #t
      

  2.   

    select indentity(int,1,1) as id,* into #t from tablename
    select * from #t
    godrop table #t
      

  3.   

    http://expert.csdn.net/Expert/topic/2437/2437014.xml?temp=.67857
    自增号
      

  4.   

    create view view_1
    as
    select ...此处好像不能用identity函数啊?
      

  5.   

    楼主要注意的是,视图其实是一个虚表。帮他加自动编号又有什么意义呢!
    你在查视图中的数据时加上自动编号不就行了。select indentity(int,1,1) as id,* form 视图
      

  6.   

    上面的错了:
    select identity(int,1,1) as id,* into #aa form 视图
    select * from #aa
    drop table #aa