今天在園子裡看了關於索引的一道經典面試題,講了這樣一個問題“從100萬條記錄中的得到成績最高的記錄”。看到這個題目,通常我們的做法是:select top 1 * from student order by score desc但是這樣做你會發現,如果有幾個人分數並列第一,這樣就只能取到一個記錄。用下面的代碼的話,就可以正確地取出分數第一的所有記錄:select top 1 with ties * from student order by score desc由於以前沒有用過with
一、排序轉換(Sort)排序轉換功能是按升序或降序對輸入資料流中的資料進行排序.並將排序後的資料複製到轉換輸出中.它類似於T-SQL中的order by 語句。下面以資料庫AdventureWorks為例來介紹一下排序轉換的使用。1.建立名為”SortDemo”的包,在控制流程中拖放一個資料流程工作,然後在連線管理員中建立一個OLE DB連接器,用於串連AdventureWorks資料庫。2.在BIDS介面左邊的變數工具箱中設定一個變數Count
一、Cacti外掛程式 Cacti外掛程式是對cacti的擴充。要使用cacti外掛程式必須先擴充cacti架構,來支援外掛程式。1. 安裝cacti外掛程式架構擴充:http://cactiusers.org/downloads/patches/目前的版本是V1.1,是專門針對cacti V0.8.6設計的。1).解壓下載的tar包,你會得到一個cacti-plugin-arch目錄# tar –zxvf cacti-plugin-arch.tar.gz# cd
文章目錄 Server authenticationUser authentication Server authenticationOne of the first things that happens when the SSH connection is being established is that the server sends its public key to the client, and proves
http://dvdhrm.wordpress.com/2012/09/13/linux-drm-mode-setting-apihttp://dvdhrm.wordpress.com/2012/12/21/advanced-drm-mode-setting-api The Direct Rendering Manager (DRM) is a subsystem of the linux kernel that manages access to graphics cards (GPUs).
在我們使用set statistics time on 來查看SQL語句執行的時間時,SQL Sever會給我們返回來兩個時間一個是CPU Time 另一個是Elapsed Time 那麼這兩個時間有什麼不同呢? CPU Time 指的是CPU在忙於執行當前任務的時間,其並沒有考慮等待時間,如IO等待,網路等待等,而Elapsed Time 則是執行當前任務所花費的總時間,也就是說這兩者之問的關係統可以表示為:Elapsed Time = Cpu Time + Wait
You receive error 7391 when you run a distributed transaction against a linked server昨天建立了一個連結的伺服器,並在一個預存程序中來使用其查詢,結果無法儲存預存程序,報的錯誤資訊就是Result Code = 0x8004d01c 也有可能是Result Code =