求一条sql语句删除库中所有属性为用户的视图?
求一条sql语句删除库中所有属性为用户的视图?
------解决方案----------------------改改
declare @sql varchar(8000)
set @sql= ' '
select @sql=@sql+ ', '+name from sysobjects
where type= 'V ' and name not in( 'syssegments ', 'sysconstraints ')
set @sql= 'drop view '+stuff(@sql, 1, 1, ' ')
exec(@sql)