查詢SQL SERVER使用的記憶體

select
(physical_memory_in_use_kb/1024)Memory_usedby_Sqlserver_MB,
(locked_page_allocations_kb/1024 )Locked_pages_used_Sqlserver_MB,
(total_virtual_address_space_kb/1024 )Total_VAS_in_MB,
process_physical_memory_low,
process_virtual_memory_low
from sys. dm_os_process_memory

T-SQL使用者函數(function)裡不能使用NEWID(副作用運算子)的解決方式

在使用者函數裡有用到NEWID、RAND等副作用運算子,會出現下面的錯誤:

【在函數中使用副作用運算子 ‘newid’ 無效。】

Read the rest of this entry »

記憶體被Ad hoc Query佔滿的解決方式

跑報表查看:報表=>標準報表=>記憶體使用量

CACHESTORE_SQLCP這個值如果佔滿很多,就表示有很多一次性的查詢,
降低佔滿記憶體的方式:

Read the rest of this entry »

T-SQL 使用CURSOR的範例

CURSOR好用,撈出資料後可以一筆一筆去處理要做的事,不過小心喔~CURSOR很吃資源…

Read the rest of this entry »

C# 呼叫執行 WinRar

using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

Read the rest of this entry »

« Older Entries   Newer Entries »