3 月
19
19
SQL SERVER 撈出資料列的值串成一行文字
declare @s nvarchar(4000)
select @s=isnull(@s+’;’ , ”)+ cast(resal001 as nvarchar)
from resal
where substring(resal001,1,1) in (‘C’,’E’,’H’,’I’,’J’,’R’)
and resal001 not in (‘CSB’,’H90′)
print @s
declare @s nvarchar(4000)
select @s=isnull(@s+’;’ , ”)+ cast(resal001 as nvarchar)
from resal
where substring(resal001,1,1) in (‘C’,’E’,’H’,’I’,’J’,’R’)
and resal001 not in (‘CSB’,’H90′)
print @s
<SCRIPT LANGUAGE="JavaScript">
// Trim() , Ltrim() , RTrim()
String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } //去除頭尾空白
String.prototype.lTrim = function() { return this.replace(/(^\s*)/g, ""); } //去除左側(頭)空白
String.prototype.rTrim = function() { return this.replace(/(\s*$)/g, ""); } //去除右側(尾)空白
String.prototype.Trim= function() { return this.lTrim().rTrim(); } //利用LTrim、RTrim來實做的trim
</SCRIPT>
**** 刪除Mail紀錄 ************************************************
–刪除所有Mail紀錄
exec sysmail_delete_log_sp