在SQL中向多个数据库中插入相同的记录
今天一个朋友问到这个问题,其实很好解决:
declare @dbname varchar(50)
declare c_database cursor for
select name from master.dbo.sysdatabases where name like '%数据库名%'
open c_database
fetch next from c_database into @dbname
while @@fetch_status=0
begin
exec('use '+@dbname
+' insert into 表名(字段) values(''内容'')')
fetch next from c_database into @dbname
end
close c_database
deallocate c_database
go
相关文档:
原文地址:http://www.blogjava.net/xingcyx/archive/2007/01/09/92638.html
使用oracle的10046事件跟踪SQL语句
我们在分析应用程序性能问题的时候,更多地需要关注其中SQL语句的执行情况,因为通常应用程序的性能瓶颈会在数据库这边,因此数据库的sql语句是我们优化的重点。利用Oracle的10046事件,可以跟踪应用程序所执 ......
(1) 选择最有效率的表名顺序(只在基于规则的优化
器中有效):
Oracle
的
解析器按照从右到左的顺序处理from子句中的表名,from子句中写在最后的表(基础表 driving
table)将被最先处理,在from子句中包含多个表的情况下,你必须选择记录条数最少的表作为基础表。假如有3个以上的表连接查询,
那就 ......
-- create by zh
-- n 是作物的时间,x 是希望在几点成熟,返回播种的时间
with t as
(
select 64 n,9 x from dual union all
select 64 n,13 x from dual union all
select 64 n,17 x from dual union all
select 64 n,20 x from dual
)
select '成熟时间:' || lpad(to_char(n),4,' ' ......
1 防止sql注入式攻击(可用于UI层控制) #region 防止sql注入式攻击(可用于UI层控制)
2
3 /**/ ///
4 /// 判断字符串中是否有SQL攻击代码
5 ///
6 /// 传入用户提交数据
7 /// ......