Home > Database > Mysql Tutorial > body text

SQL的小常识, 备忘之用, 慢慢补充.

WBOY
Release: 2016-06-07 18:03:51
Original
796 people have browsed it

SQL的小常识, 备忘之用, 慢慢补充.

1. @@rowcount: 获取受影响行数
代码如下:
update SNS_TopicData set TopicCount=TopicCount+1 where Topic ='1'
if @@rowcount>0
begin
print '成功'
end
else
begin
print '失败'
end

2.存储过程的调用
代码如下:
--申明返回变量
declare @topicCount int
--执行
EXEC [SNS_TopicData_BlogAdd]
--返回值设置
@topicCount output,
--参数传入
@topic='huati'
--输出返回值
PRINT @topicCount

3. 不锁表 with(nolock)
代码如下:
SELECT * FROM SNS_TopicData WITH(nolock)

原文:http://www.cnblogs.com/henw/archive/2011/10/18/2216593.html
Related labels:
sql
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!