create table # 
(
Name Varchar(50),
Num Int
)insert #
select 'a',1select * from #drop table #
declare @t table 
(
Name Varchar(50),
Num Int
)
insert @t
select 'a',1select * from @t

解决方案 »

  1.   

    declare @tb table
    (
      ID int identity primary key,
      Name varchar(50),
      Num int
    )create table #tb
    (
      ID int identity primary key,
      Name varchar(50),
      Num int
    )
      

  2.   

    declare @table table---建立表变量
    (
      ID int identity primary key,----建立索引键  Name varchar(50),
      Num int
    )create table #table
    (
      ID int identity primary key,----建立索引键
      Name varchar(50),
      Num int
    )