一个页面访问量较多,页面中有不少执行SQL操作的地方,如
select title,content,hit from a where id=11
update a set hit=hit+1 where id=11
update a_hot set hit=hit+1
delete a_xx where id=11
……,大概有10多个的执行操作,我一直对存储过程有好感,因此,我想上面的语句都用存储过程去执行是否会好点?Create PROCEDURE [SP_ExecSql]
@Sql nvarchar(1000)
AS
BEGIN
exec(@sql)
END------------------页面中所有执行SQL语句的都换成 SP_ExecSql Sql 页面速度会不会快点?
select title,content,hit from a where id=11
update a set hit=hit+1 where id=11
update a_hot set hit=hit+1
delete a_xx where id=11
……,大概有10多个的执行操作,我一直对存储过程有好感,因此,我想上面的语句都用存储过程去执行是否会好点?Create PROCEDURE [SP_ExecSql]
@Sql nvarchar(1000)
AS
BEGIN
exec(@sql)
END------------------页面中所有执行SQL语句的都换成 SP_ExecSql Sql 页面速度会不会快点?
这样转换没任何意义
实际上,我做过查询测试,使用存储过程确实快一点!