如题
谢谢!!!

解决方案 »

  1.   

    新增一列
    ALTER TABLE T_test
    ADD ID int IDENTITY(1,1)
      

  2.   

    是行的序号吧?
    用identity列
      

  3.   

    select * ,(select count(*) from 表 where 表.主键>=a.主键 ) as 编号
    from 表 a
      

  4.   

    select *, IDENTITY(1,1)
    from 表
      

  5.   

    不是行中主键的值
    是新生一列,值等于该列从1排下来的顺序!wscft(努力工作,开心生活!) 我试了 说有语法错误,还没找到错误!!
      

  6.   

    declare @t table([name] varchar(10))
    insert into @t select '11'
    insert into @t select '221'
    insert into @t select '21'
    insert into @t select '4'
    insert into @t select '55'
    insert into @t select '66'select [id]=identity(int,1,1),* into # from @t
    select * from #
    drop table #
      

  7.   

    错了应该是这样:
    select *, IDENTITY(int, 1,1)
    from 表
      

  8.   

    只用在带有 INTO table 子句的 SELECT 语句中,以将标识列插入到新表中。尽管类似,但是 IDENTITY 函数不是与 CREATE TABLE 和 ALTER TABLE 一起使用的 IDENTITY 属性。
    正确的写法应该是
    select *,identity(int,1,1) as [id] into #表名1 from 表名2
      

  9.   

    在DELPHI 中用一个WHILE DO
      

  10.   

    SELECT IDENTITY(int, 1, 1) AS [ID], * INTO 新表 FROM 表名
    哈哈又学到东西