63 lines
1.9 KiB
HTML
63 lines
1.9 KiB
HTML
<div id="sina_keyword_ad_area2" class="articalContent ">
|
||
<div>
|
||
<div>distinct :去掉查询结果集中的重复记录 例如:SELECT DISTINCT * FROM Table</div>
|
||
<div><br />
|
||
</div>
|
||
<div>truncate table : 清空表,自增ID重新开始 例: TRUNCATE TABLETablename</div>
|
||
<div><br />
|
||
</div>
|
||
<div>INSERT INTO 后使用SELECT @@IDENTITY 会反回自增ID</div>
|
||
<div><br />
|
||
</div>
|
||
<div>DUMP TRANSACTION JobIntern WITH NO_LOG删除数据库日志2008中已取消这个功能</div>
|
||
|
||
|
||
</div>
|
||
<div><br />
|
||
</div>
|
||
<div><span style="font-family: 'Segoe UI',Verdana,Arial; font-size: 12px;"><span style="line-height: normal;">返回受上一语句影响的行数。如果行数大于 20亿,请使用</span></span><a href="http://msdn.microsoft.com/zh-cn/library/ms181406(v=SQL.90).aspx" target="_blank">ROWCOUNT_BIG</a></div>
|
||
<div>
|
||
<div>
|
||
<div>UPDATE t_pub_param SET ParamValue = @ParamValue WHEREParamName = @ParamName</div>
|
||
<div>IF @@rowcount < 1</div>
|
||
<div>BEGIN</div>
|
||
<div>INSERT t_pub_param(ParamName, ParamValue) values(@ParamName,@ParamValue)</div>
|
||
<div>END</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div><br />
|
||
</div>
|
||
<div>EXISTS:指定一个子查询,检测行的存在</div>
|
||
<div>
|
||
<div>if(exists(select * from <span style="line-height: 21px;">t_pub_param </span>where <span style="line-height: 21px;">ParamValue= @ParamValue</span> ))</div>
|
||
<div>BEGIN</div>
|
||
<div>SET @re = 1</div>
|
||
<div>END</div>
|
||
<div><br />
|
||
</div>
|
||
<div>
|
||
<div>ISDATE() --函数判断所给定的表达式是否为合理日期</div>
|
||
<div>语法</div>
|
||
<div>ISDATE ( expression )</div>
|
||
<div>参数</div>
|
||
<div>expression</div>
|
||
<div>一个表达式,将要验证它是否为一个日期。expression 是任何返回 varchar 数据类型的表达式。</div>
|
||
|
||
|
||
</div>
|
||
<div>返回值</div>
|
||
<div>0:表示非日期类型(空串[''],空值[null]都为0)</div>
|
||
<div>1:表示日期类型</div>
|
||
<div><br />
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<p> </p> |