declare @row varchar(30)
declare @tbname varchar(30)
  DECLARE   string_find_cursor   CURSOR   FAST_FORWARD   FOR    
  SELECT   [name]  
  FROM   sysobjects   where   type='U' and name like 'A%'
  ORDER   BY   [name]  

   OPEN   string_find_cursor  
 
  FETCH   NEXT   FROM   string_find_cursor    
  INTO   @tbname  

WHILE   @@FETCH_STATUS   =   0  
  BEGIN  
   --select  @row=count(*) from  @tbname
  select @row=rows from sysindexes where id = object_id(cast(@tbname as varchar(30))) and indid in (0,1)
if(cast(@row as int))>0
  print @tbname+'  '+@row+'  '+'select * from '+@tbname
  FETCH   NEXT   FROM   string_find_cursor    
  INTO   @tbname  
  END    
   
  CLOSE   string_find_cursor  
  DEALLOCATE   string_find_cursor

相关文章:

  • 2022-12-23
  • 2022-01-06
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-11-07
猜你喜欢
  • 2022-01-20
  • 2021-08-07
  • 2021-10-02
  • 2021-10-19
  • 2021-07-29
  • 2021-07-02
相关资源
相似解决方案