autoid

检查当前库下内容含有指定字符的所有存储过程

岁酱吖の 提交于 2020-03-29 04:43:52
由于配置表改变了,要对当前数据库下所有SP进行检查,对于有引用这个表的SP都要作相应的改变,如果是一个一个SP查询,那工作量太大了,所以写了一个SP,对包含有对该表引用的SP都列出来。 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author:jim.yang -- Create date: 2009-9-2 -- Description:检查当前库下内容含有指定字符的所有存储过程 -- #p_procedure_searchStr 'sms_5' -- ============================================= ALTER PROCEDURE #p_procedure_searchStr @str varchar(100) AS BEGIN create table #t1(name varchar(100),text varchar(8000)) create table #t2(text varchar(8000)) --得到库所有的sp select identity(int,1,1) autoid,name into #proc from sys.Procedures where

oracle查询重复数据方法

社会主义新天地 提交于 2019-12-10 18:40:59
SQL重复记录查询 1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from people group by peopleId having count (peopleId) > 1) 2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录 delete from people where peopleId in (select peopleId from people group by peopleId having count (peopleId) > 1) and rowid not in (select min(rowid) from people group by peopleId having count(peopleId )>1) 3、查找表中多余的重复记录(多个字段) select * from vitae a where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1) 4、删除表中多余的重复记录(多个字段)

ORACLE查询并删除重复记录

China☆狼群 提交于 2019-12-02 17:49:13
查询及删除重复记录的SQL语句 1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录 delete from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) and rowid not in (select min(rowid) from people group by peopleId having count(peopleId )>1) 注:rowid为oracle自带不用该..... 3、查找表中多余的重复记录(多个字段) select * from vitae a where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having count(*) > 1) 4