Select * into #tmp from 表
drop table 表
select * into 表 from #tmp

解决方案 »

  1.   

    先用DBCC CHECKDB检查结构,然后再用DBCC CHECKTABLE检查表完整性
      

  2.   

    dbcc checktable('a')===>
    DBCC results for 'a'.
    There are 24 rows in 1 pages for object 'a'.
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.好像沒什么反應嘛
      

  3.   

    1、
    use  master 
    go
    create  proc  killspid  (@dbname  varchar(20))  
    as  
    begin  
    declare  @sql  nvarchar(500),@temp varchar(1000)
    declare  @spid  int  
    set  @sql='declare  getspid  cursor  for    
    select  spid  from  sysprocesses  where  dbid=db_id('''+@dbname+''')'  
    exec  (@sql)  
    open  getspid  
    fetch  next  from  getspid  into  @spid  
    while  @@fetch_status  <  >-1  
    begin  
      set @temp='kill  '+rtrim(@spid)
      exec(@temp)
    fetch  next  from  getspid  into  @spid  
    end  
    close  getspid  
    deallocate  getspid  
    end  --用法  
    use  master  
    exec  killspid  '数据库名'再打开呢?或从起sqlserver服务呢?
      

  4.   

    use  master 
    go
    create  proc  killspid  (@dbname  varchar(20))  
    as  
    begin  
    declare  @sql  nvarchar(500),@temp varchar(1000)
    declare  @spid  int  
    set  @sql='declare  getspid  cursor  for    
    select  spid  from  sysprocesses  where  dbid=db_id('''+@dbname+''')'  
    exec  (@sql)  
    open  getspid  
    fetch  next  from  getspid  into  @spid  
    while  @@fetch_status  <  >-1  
    begin  
      set @temp='kill  '+rtrim(@spid)
      exec(@temp)
    fetch  next  from  getspid  into  @spid  
    end  
    close  getspid  
    deallocate  getspid  
    end  --用法  
    use  master  
    exec  killspid  '数据库名'再打开呢?或从起sqlserver服务呢?
      

  5.   

    直接執行以下sql: 
    select  spid  from  sysprocesses  where  dbid=7 
    (我當前的dbid為7, 沒有得到任何一條數據)我重啓過sqlserver服務得到一樣的結果。我剛剛又查暸一下,不光是我所用的數據庫是這樣,所有的數據庫中的所有錶都是這樣,用
    企業管理器打開,都不行。鬱悶
      

  6.   

    所有的數據庫中的所有錶都是這樣re:create database test
    go
    use test
    go
    select * from sysobjects呢?
      

  7.   

    齣現的問題還是一樣的。就是用查詢分析器可以,但是企業管理器就會報上麵提到的error而且是“Unspecified err”,真讓人莫名啊:(
      

  8.   

    会不会是MMC控制台出了问题,有没有试过在另一台机器进行管理?
      

  9.   

    因此是:“Unspecified err”。我也不知道怎么回事。重装,我也想过,但是,现在这套系统是在运作中的,我怕在安装的时候会发生意外,而且重新安装也很费时费力,至少要先备份数据。天哪。我要疯了。现在的数据可能有达到100W条级别了。总之,先谢了,大家。还有,大力,如果要重新安装的话,要注意点什么,比如数据的备份什么的,或者有什么好的方法可以比较傻瓜式安装,就像win98覆盖安装那样。  ;)
      

  10.   

    拷贝你的data目录下的数据库文件,步骤:    停止sql服务或脱机-->拷贝你的data目录下的数据库文件如果你格式化后安装粘贴你的数据库文件到目标机上,步骤:    右键数据库-->所有任务-->附加数据库