T-Sql语句删除全部存储过程

 

select distinct name from table打开重复记录的单个字段

select  * from table where fid in(Select min(fid) FROM table group by name)打开重复记录的所有字段值

select   *   from   table   where   name in(select   name   from   table   group   by   name     having   count(name)=1)打开重复任意次数的所有记录

 

×××××××××××××××××××××××××××××××××××××××××

删除全部存储过程

----------------------------------------------------------------------------------------------

declare @procName varchar(500)

      declare cur cursor

            for select [name] from sys.objects where type = 'p'

      open cur

      fetch next from cur into @procName

      while @@fetch_status = 0

      begin

            if @procName <> 'DeleteAllProcedures'

                  exec('drop procedure ' + @procName)

                  fetch next from cur into @procName

      end

      close cur

      deallocate cur

你可能感兴趣的:(sql)