--如果你的视图不超过4000个字符的话(通常没那么长)select m.text from (select a.text,a.id
from syscomments a,sysobjects b
where a.id = b.id and b.type = 'v'union allselect 'go',a.id+0.5 
from syscomments a,sysobjects b
where a.id = b.id and b.type = 'v'
                     ) as m
order by m.id

解决方案 »

  1.   

    --设置将结果保存为文件,支持8000个字符。select m.text from (select text=rtrim(c.text)+isnull(ltrim(d.text),''),c.id from
         (select a.text,a.id
         from syscomments a,sysobjects b
         where a.id = b.id and colid = 1 and b.type = 'v') as c
         left join syscomments d
         on c.id = d.id and d.colid = 2union allselect 'go',a.id+0.5 
    from syscomments a,sysobjects b
    where a.id = b.id and b.type = 'v'
                         ) as m
    order by m.id
      

  2.   

    右键生成sql语句或使用DTS导入导出工具