ORACLE数据库中,我们会使用一些SQL语句找出存在隐式转换的问题SQL,其中网上流传的一个SQL语句如下,查询V$SQL_PLAN的字段FILTER_PREDICATES中是否存在INTERNAL_FUNCTION: SELECT SQL_ID, PLAN_HASH_VALUE FROM V$SQL_PLAN X WHERE X.FILTER_PREDICATES LIKE '%INTERNAL_FUNCTION%' GROUP BY SQL
方便删除数据库中所有的数据表,清空数据库,有些有约束,不能直接delete,需要先删除库中的约束,代码如下: --删除所有约束DECLARE c1 cursor for select 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; ' from sysobjects where xtype = 'F'open c1declare @c1 varchar(8000)fetch next from c
DECLARE @tablename VARCHAR(30),@sql VARCHAR(500)DECLARE cur_delete_table CURSOR READ_ONLY FORWARD_ONLY FORSELECT name FROM sysobjects WHERE name LIKE 'PUB%' AND type='U'OPEN cur_delete_tableFETCH NEXT FROM cur_delete_table INTO @tablenameWHILE @@FETC