我不会,给个例子或连接看看都行,谢谢诸位仁兄了~

解决方案 »

  1.   

    create table #t(no varchar(20))
    --插入
    insert into #t(no)
    select 'a'
    union all select 'b'
    union all select 'c'
    --更新
    update #t
    set no = 'aa'
    from #t
    where no = 'a'
    --删除
    delete from #t where no = 'aa'
      

  2.   

    用完之后drop掉
    drop table #t
      

  3.   

    create table #table(id int)
      

  4.   

    create table #table(id int)
    insert into #table(id) values(1)
    ud
    update #table set id=12
    drop table #table
      

  5.   

    为什么不使用表变量,表变量的性能比临时表要高的。因为表变量的数据暂时存储在内存中,而不是硬盘上。declare @tmpdata table (categoryid int,categorynm varchar(50))
    
    insert into @tmpdata (categoryid, categorynm)
    select categoryid, categoryname from categories
    
    select * from @tmpdata