能 !
如果CREATE TABEL #TEMP....没有问题
如果CREATE TABEL TEMP....有问题

解决方案 »

  1.   

    可是我用的就是这个呀!
    create table #temp
      (
             idid    int     IDENTITY (1, 1) NOT NULL ,
    DLLX varchar(4) not null,
    sl decimal(8,2) not  NULL,  --//金额(数量*单价)
    dj decimal(8,2) not  NULL  -//金额(数量*单价)
    --JE decimal(8,2) not  NULL   
       )
    按它提示的意思好像是:触发器不能建立临时表,是吗?
      

  2.   

    在SQLSERVER2000 我没试过,SQL7我也用过,如下:
      
      select * into temp_0 from account_detail  where 9 = 8
      。
      insert into  temp_0(...)  values(...)
      
      drop table temp_0
      
    不过,最好不要建临时表,就怕多重触发,先建好视图,再在触发器里调用比较安全。
      

  3.   

    哦!对呀,我怎么没有想到用视图呢?
    我马上试一试,谢谢你呀!wzsswz(岌岌荆棘) :)
      

  4.   

    触发器中不能用create语句创建表,但可以用SELECT * INTO B FROM A 之类的格式创建。
      

  5.   

    可是表B也需要定义呀!这个表是不存在的!难道要在SQL中建一个固定的表存临时数据嘛?