搜尋本站文章

2011-04-30

VS 2010 SP1 造成 SSMS 管理工具中的 IntelliSense 功能失效

Visual Studio 2010 SP1 造成 SQL Server 2008 R2 SSMS 管理工具中的 IntelliSense 功能失效

Visual Studio 2010 SP1 的 IntelliSense 相容性問題

如果您有 SQL Server 2008 R2 管理 Studio RTM 正在執行 Visual Studio 2010 SP1 的電腦上安裝,您可能會遇到相容性問題,Microsoft SQL Server 2008 R2 管理 Studio (SSMS 2008 R2) 與 TRANSACT-SQL 語言服務隨附於 Visual Studio 2010 SP1 中之間。

若要解決這個問題,請為 SQL Server 2008 R2 安裝累積更新 7 http://support.microsoft.com/kb/2507770

--00A


--00B



以下為下載的畫面:

--01


--02



以下為安裝的畫面,以 x64 版本為例:

安裝 SQLServer2008R2-KB2507770-x64.exe

KB 文章編號:2451688, 2476322, 2478514, 2481274, 2484392, 2489667, 2491510, 2492931, 2497561, 2497575, 2498145, 2498818, 2503834, 2504090, 2505256, 2506795, 2506799, 2507443, 2507543, 2507770, 2509659, 2510668, 2511151, 2513833, 2515286, 2515489, 2516163, 2516439, 2518716, 2518808, 2518876, 2519358, 2520240, 2520808, 2521127, 2522708, 2525266, 2525273, 2526552, 2526959, 2531172, 2531482, 2531826, 2532079, 968215
語言:All (Global)
平台:x64
地點:xxx\431250_intl_x64_zip.exe

--03


--04


--05


--06


--07


--08


--09


--10


--11


--12




參考資料:

SQL Server 2008 R2 的累積的更新套件 7
http://support.microsoft.com/kb/2507770

修正: SQL Server 2008 R2 的 SQL 伺服器管理 Studio 中的 IntelliSense 功能可能會停止運作之後安裝 Visual Studio 2010 Service Pack 1
http://support.microsoft.com/kb/2531482

SSMS 2008 R2 is losing Intellisense after installing Visual Studio 2010 SP1
http://connect.microsoft.com/SQLServer/feedback/details/650569/ssms-2008-r2-is-losing-intellisense-after-installing-visual-studio-2010-sp1

2011-04-28

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(4)

在前一期文章中,介紹了認識「活動訊號網路」、安裝「分散式交易協調器」、認識「主動/被動」以及「主動/主動」模式、使用「容錯移轉叢集管理員」檢視各個「節點伺服器」,以及測試容錯移轉的功能等主題。

在本期文章裡,將繼續討論在第一台「節點伺服器」上安裝 SQL Server 容錯移轉叢集、使用「容錯移轉叢集管理員」檢視已經安裝的 SQL Server 容錯移轉叢集等主題。




更多相關的技術文章,請參考:DB World 資料庫專家電子雜誌
http://www.dbworld.com.tw/




參考資料:

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(1)
http://sharedderrick.blogspot.com/2011/01/sql-server-2008failover-cluster1.html

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(2)
http://sharedderrick.blogspot.com/2011/03/sql-server-2008failover-cluster2.html

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(3)
http://sharedderrick.blogspot.com/2011/04/sql-server-2008failover-cluster3.html

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(3)

在前一期文章中,介紹了執行驗證「容錯移轉叢集」環境作業、執行「建立叢集精靈」來安裝「容錯移轉叢集」,而在完成「容錯移轉叢集伺服器」後,組態設定設「叢集仲裁模式」、設定「叢集磁碟」、設定「叢集網路」等主題。

在本期文章裡,將繼續討論「活動訊號網路」、安裝「分散式交易協調器」、認識「主動/被動」以及「主動/主動」模式、使用「容錯移轉叢集管理員」檢視各個「節點伺服器」,以及測試容錯移轉的功能等主題。




更多相關的技術文章,請參考:DB World 資料庫專家電子雜誌
http://www.dbworld.com.tw/




參考資料:

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(1)
http://sharedderrick.blogspot.com/2011/01/sql-server-2008failover-cluster1.html

新手學安裝SQL Server 2008「容錯移轉叢集(Failover Cluster)」(2)
http://sharedderrick.blogspot.com/2011/03/sql-server-2008failover-cluster2.html

使用 PowerPivot for Excel:SQL Server 2008 R2 (1)

以下的實作練習,參考自 PowerPivot 網站上提供的實作練習。

實作練習:匯入資料到 PowerPivot for Excel

包含以下的工作:
  • 工作01:設定 PowerPivot 的資料來源
  • 工作02:組態匯入資料
  • 工作03:設定計算資料行(calculated column)
  • 工作04. 更新資料與修改資料連線



工作01:設定 PowerPivot 的資料來源

步驟01. 執行 Excel 2010。
步驟02. 在上方工作選單,點選「PowerPivot」。
--01


步驟03. 點選左邊的「PowerPivot 視窗」按鈕。
--02


步驟04. 系統會產生一個新的視窗:「PowerPivot for Excel - 活頁簿1」視窗。
--03


步驟05. 點選「從資料庫」按鈕,選擇「從 SQL Server」。
--04


步驟06. 在「資料表匯入精靈」視窗,輸入以下的參數:

  • 在「伺服器名稱」方塊,輸入:localhost。
  • 在「登入伺服器」方塊,點選「使用 Windows 驗證」。
  • 在「資料庫名稱」方塊,下拉選擇:ContosoRetailDW。

--05


步驟07. 點選「測試連接」,在「PowerPivot for Excel」視窗,點選「確定」,點選「下一步」。
--06



工作02:組態匯入資料

步驟01. 在「選擇如何匯入資料」視窗,點選「從資料表和檢視表清單選取來選擇要匯入的資料」,點選「下一步」。
--07


步驟02. 在「選取資料表和檢視表」視窗,輸入以下的參數:

  • 在「來源資料表」區域,勾選:FactSales。
  • 在「易記名稱」方塊,輸入:Sales。
  • 點選「選取相關資料表」。系統會自動顯示:「已選取相關資料表 6」。

--08


步驟03. 延續步驟09,繼續執行以下的設定作業:

  • 點選「預覽和篩選」。
  • 在「預覽選取的資料表」視窗,在左上角,取消勾選「SalesKey」。

--09


--10


向右邊拉動橫向捲軸,取消勾選「CurrencyKey」。
--11


步驟04. 點選「確定」。

步驟05. 在「選取資料表和檢視表」視窗,可以觀察到在「篩選詳細資料」區域,有特別顯示出「套用的篩選」。
--12


步驟05. 點選「完成」。

步驟06. 在「匯入中」視窗,可以觀察到以下的資料:
--13


在 Sales 資料表,有近 400 百萬筆資料列匯入到 Excel 2010 內來存放處理。

步驟07. 點選「詳細資料」,在「詳細資料」視窗,點選「確定」,再點選「關閉」。
--14



工作03:設定計算資料行(calculated column)

步驟01. 在下方工作列,點選左邊的「DimChannel」頁籤,滑鼠右鍵,選擇「重新命名」,修改為:Channel,按下「Enter」鍵。
--15


步驟02. 點選「Sales」頁籤,向右邊拉動橫向捲軸,點選「加入資料行」。
--16


步驟03. 在其上方的公式 fx 區域,輸入:[SalesAmount] - [TotalCost],按下「Enter」鍵。
--17


步驟04. 點選「CalculatedColumn1」,滑鼠右鍵,選擇「重新命名資料行」,輸入:Profit,按下「Enter」鍵。
--18


步驟05. 在左上角的區域,點選下拉圖示,點選「儲存」,輸入檔名後,點選「儲存」。
--19


--20


--21



工作04. 更新資料與修改資料連線

步驟01. 在「PowerPivot for Excel」視窗,在「首頁」頁籤,點選「重新整理」圖示。
--22


步驟02. 在「資料重新整理進度」視窗,等待片刻後,點選「關閉」。
--23


步驟03. 點選「設計」頁籤,點選「現有連接」按鈕。
--24


步驟04. 在「現有連接」視窗,在「選取資料來源連接」 區域,檢視「PowerPivot 資料連接」區域。點選「編輯」。
--25


步驟05. 在「編輯連接」視窗,點選「取消」,「關閉」。
--26



參考資料:

PowerPivot for Excel 簡介
http://technet.microsoft.com/zh-tw/library/ee835651.aspx

PowerPivot for Excel
http://technet.microsoft.com/zh-tw/ff604673.aspx

了解 PowerPivot 功能
http://technet.microsoft.com/zh-tw/library/ff452206.aspx

PowerPivot UI 導覽
http://technet.microsoft.com/zh-tw/library/ee835591.aspx

建立您的第一個 PowerPivot 活頁簿 (教學課程)
http://technet.microsoft.com/zh-tw/library/ee835510.aspx

PowerPivot | Home
http://www.powerpivot.com/index.aspx

PowerPivot | Videos
http://www.powerpivot.com/videos.aspx

PowerPivot Team Blog
http://blogs.msdn.com/powerpivot

Introducing PowerPivot
http://blogs.msdn.com/excel/archive/2009/10/22/introducing-powerpivot.aspx

PowerPivot for SharePoint 2010 – The Business User’s Perspective
http://blogs.msdn.com/excel/archive/2009/10/29/powerpivot-for-sharepoint-2010-the-business-user-s-perspective.aspx

Microsoft Contoso BI Demo Dataset for Retail Industry
http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=868662dc-187a-4a85-b611-b7df7dc909fc

2011-04-23

無法解析 equal to 作業中...之間的定序衝突(Cannot resolve the collation conflict between...in the equal to operation) :當資料行的定序不相同,資料表聯結無法正常執行(2)

資料表聯結(Table Join)對象是「暫存資料表(Temporary Table)」或是「資料表變數(Table Variable)」時,會有以下的注意事項:

(一) 「暫存資料表(Temporary Table)」
定序與 tempdb
tempdb 資料庫在每次 SQL Server 啟動時建立,且預設定序與 model 資料庫相同。

通常與執行個體的預設定序相同。

如果建立使用者資料庫,並指定與 model 不同的預設定序,使用者資料庫的預設定序就會與 tempdb 不同。

所有暫存預存程序或暫存資料表會在 tempdb 中建立及儲存。

這表示暫存資料表中所有隱含的資料行,與暫存預存程序中所有可強迫的常數、變數與參數,都會與建在永久資料表和預存程序中的同等物件具有不同的定序。

(二) 「資料表變數(Table Variable)」
若未指定 collation_definition,資料行就會繼承目前資料庫的定序。


請參考以下的範例程式碼:

(一) 「暫存資料表(Temporary Table)」
-- 傳回 SQL Server 支援的全部「定序(collation)」之清單。
SELECT name N'定序', description N'描述' 
FROM fn_helpcollations()
-- WHERE name LIKE 'Chinese_Taiwan%'



-- 查詢各個資料庫的「預設定序(default collation)」
SELECT name N'資料庫', collation_name N'預設定序' 
FROM sys.databases 



-- EX1. 使用暫存資料表,資料表聯結(Table Join)
USE Northwind
GO
CREATE TABLE #Customers01
( CustomerID nchar(5), ContactName nvarchar(30), Phone nvarchar(24) )
GO
INSERT #Customers01
 SELECT CustomerID, ContactName, Phone FROM Northwind.dbo.Customers
GO

-- 使用暫存資料表來執行資料表聯結,產生錯誤,因為 Tempdb 與 使用者資料庫兩者的定序是不同
SELECT *
FROM Northwind.dbo.Orders O INNER JOIN #Customers01 C
ON O.CustomerID =C.CustomerID 

/* 錯誤訊息
訊息 468,層級 16,狀態 9,行 3
無法解析 equal to 作業中 ""Chinese_Taiwan_Stroke_BIN"" 與 "Chinese_Taiwan_Stroke_CI_AS" 之間的定序衝突。
 
Msg 468, Level 16, State 9, Line 3
Cannot resolve the collation conflict between ""Chinese_Taiwan_Stroke_BIN"" and "Chinese_Taiwan_Stroke_CI_AS" in the equal to operation.
*/

DROP TABLE #Customers01
GO

--可能的解決方式
--(1) 修改暫存資料表的「定序」,使用 COLLATE database_default
CREATE TABLE #Customers01
( CustomerID nchar(5) COLLATE database_default
 , ContactName nvarchar(30), Phone nvarchar(24) )
GO

--(2) 修改暫存資料表的「定序」,使用 COLLATE Chinese_Taiwan_Stroke_CI_AS
CREATE TABLE #Customers01
( CustomerID nchar(5) COLLATE Chinese_Taiwan_Stroke_CI_AS
 , ContactName nvarchar(30), Phone nvarchar(24) )
GO

--(3) 使用 COLLATE DATABASE_DEFAULT:使 COLLATE 子句繼承目前資料庫的定序。
SELECT *
FROM Northwind.dbo.Orders O INNER JOIN #Customers01 C
ON O.CustomerID =C.CustomerID COLLATE DATABASE_DEFAULT

--(4) 使用 COLLATE 子句,轉換為定序為:Chinese_Taiwan_Stroke_CI_AS
SELECT *
FROM Northwind.dbo.Orders O INNER JOIN #Customers01 C
ON O.CustomerID =C.CustomerID COLLATE Chinese_Taiwan_Stroke_CI_AS



(二) 「資料表變數(Table Variable)」

-- EX2. 使用資料表變數
-- 資料表變數:若未指定 collation_definition,資料行就會繼承目前資料庫的定序。

DECLARE @tbCustomers01 TABLE ( CustomerID nchar(5), ContactName nvarchar(30), Phone nvarchar(24) )

INSERT @tbCustomers01
 SELECT CustomerID, ContactName, Phone FROM Northwind.dbo.Customers

SELECT *
FROM Northwind.dbo.Orders O INNER JOIN @tbCustomers01 C
ON O.CustomerID =C.CustomerID  




參考資料:

無法解析 equal to 作業中...之間的定序衝突(Cannot resolve the collation conflict between...in the equal to operation) :當資料行的定序不相同,資料表聯結無法正常執行;Msg 468, Level 16, State 9, Line 3 (1)
http://sharedderrick.blogspot.com/2011/04/equal-to-cannot-resolve-collation.html

使用定序
http://technet.microsoft.com/zh-tw/library/ms187582.aspx

設定與變更資料行定序
http://technet.microsoft.com/zh-tw/library/ms190920.aspx

COLLATE (Transact-SQL)
http://technet.microsoft.com/zh-tw/library/ms184391.aspx

資料表 (Transact-SQL)
http://technet.microsoft.com/zh-tw/library/ms175010.aspx

INF:常見問題集 - SQL Server 2000 - 資料表變數
http://support.microsoft.com/?kbid=305977

2011-04-22

認識與安裝 PowerPivot for Excel:SQL Server 2008 R2

PowerPivot 是指應用程式服務的集合,它們會針對使用 Excel 和 SharePoint 建立及共用商務智慧,提供端對端的解決方案。

而這集合包含了:

(1) PowerPivot 活頁簿和 PowerPivot 資料

(2) PowerPivot for Excel

(3) PowerPivot for SharePoint

(4) SharePoint 整合模式下的 Analysis Services 服務

(5) PowerPivot 系統服務

(6) PowerPivot 服務應用程式

(7) PowerPivot 應用程式資料庫

(8) PowerPivot Web 服務和 PowerPivot Managed 延伸模組

(9) 自助式商務智慧

等應用程式與服務。



與其他 SQL Server 元件相較之下,PowerPivot 資料不會使用您用來建立其他 SQL Server 或 Analysis Services 資料來源的相同工具和應用程式來建立、檢視或管理。

若要建立 PowerPivot 資料,您必須使用 PowerPivot for Excel。

PowerPivot for Excel 是 Excel 2010 的增益,可用來組合 Excel 活頁簿內部的 PowerPivot 資料。

它是唯一用來建立或修改 PowerPivot 資料的用戶端應用程式。

Business Intelligence Development Studio 之類的其他撰寫工具,則無法用來建立或修改 PowerPivot 資料。

SQL Server PowerPivot for Excel 是 Excel 2010 的增益集,您可以從網頁上下載該增益集,並用來建立或檢視 PowerPivot 活頁簿。

此增益集包括下列元件:
(1) Excel 功能區中的 PowerPivot 功能表。

(2) 開啟在 Excel 之上方的 PowerPivot 視窗。它會提供設計介面和工具來加入資料,並將資料產生關聯以及使資料更豐富。

(3) 本機 Analysis Services VertiPaq 引擎,它會壓縮及載入資料,並將資料提供給工作表中的資料視覺化物件 (如樞紐分析表) 使用。

(4) 更新版本的 AMO、ADOMD.NET 和 Analysis Services OLE DB 提供者,可支援與 PowerPivot 資料之間的連接。

(5) ATOM 資料摘要提供者,可匯入及重新整理 ATOM 格式的資料。


Microsoft® PowerPivot for Microsoft® Excel 2010 提供突破性的技術。
例如,快速操作大型資料集 (通常包含數百萬個資料列)、簡化資料的整合,而且能夠透過 Microsoft® SharePoint 2010,輕鬆共用您的分析結果。

--01


--02



Microsoft® PowerPivot for Microsoft® Excel 2010 是一種資料分析工具,可以在使用者已經熟知而且喜愛的軟體 Microsoft® Excel 中直接提供強大的運算能力。

您可以使用驚人的速度,將大量資料轉換為有意義的資訊,以便在幾秒內得到您需要的答案。

您可以毫不費力地與其他人分享您發現的事物。

您可以:
(1) 處理大型資料集 (通常包含數百萬個資料列) 的效能相當於運用 PowerPivot 記憶體中的引擎與有效的壓縮演算法處理數百個資料列的效能

(2) 使用 PowerPivot 直接從 Windows Azure Marketplace 的 DataMarket 部分存取受信任的進階及公用網域資料

(3) 從大量來源 (包括企業資料庫、試算表、報表、文字檔和網際網路資料摘要) 整合資料

(4) 超越標準 Excel 運算式並使用 PowerPivot 的 Data Analysis Expressions (DAX) 語言來執行功能強大的資料操作。

如同在資料庫一樣,遵循資料表間的關聯性,並使用熟悉並且直覺式的運算式定義複雜的計算

(5) 以互動方式瀏覽、分析與建立報表,而不依賴使用原生 Excel 2010 功能 (例如樞紐分析表、交叉分析篩選器和其他熟悉的分析功能) 的專業知識和專門訓練


Excel 版本需求

建立包含 PowerPivot 資料的 Excel 活頁簿同時需要 Excel 2010 和 PowerPivot for Excel 增益集。

在您建立活頁簿後,可以將它發行到 SharePoint Server 2010 伺服陣列,這個伺服陣列具有 Excel Services 與 SQL Server PowerPivot for SharePoint 的部署。

您可以在 Excel 2007 中開啟 PowerPivot 活頁簿。

但是,Excel 2007 不能用來建立或修改 PowerPivot 資料,或是與使用 PowerPivot 資料的樞紐分析表或樞紐分析圖互動。

您必須使用 Excel 2010 來取得所有 PowerPivot 功能的完整存取權。

若要使用 PowerPivot for Excel 的完整功能,您必須具備 Excel 2010 的 64 位元版本。

在 Windows 平台上,64 位元的作業系統與用戶端應用程式提供更多可定址的記憶體,以便您建立包含數百萬個資料列的活頁簿。


在用戶端上載入及計算 PowerPivot 資料

PowerPivot for Excel 包含在 Excel 中於同處理序 (In-Process) 執行的 Analysis Services VertiPaq 引擎

用戶端應用程式會使用 AMO 和 ADOMD.NET,接著使用 Analysis Services OLE DB 提供者,以連接及查詢活頁簿內的 PowerPivot 資料。

Analysis Services VertiPaq 引擎會在工作站上發出查詢,然後從不同的資料來源接收資料,包括關聯式或多維度資料庫、文件、公用資料存放區或 Web 服務。

在資料匯入和用戶端資料重新整理期間,對外部來源的所有資料存取都是透過在 Excel 處理序內執行的 Analysis Services VertiPaq 引擎。

下圖說明從 Excel 進行 PowerPivot 資料存取。圖中顯示支援資料處理的元件。
如需有關支援的資料來源及建立 PowerPivot 資料的詳細資訊,請參閱隨著 PowerPivot for Excel 增益集一起安裝的說明。

--0201



如果您要將包含 PowerPivot 資料的 Excel 活頁簿發行到 SharePoint 文件庫,當您想要從 SharePoint 網站檢視活頁簿時,您必須擁有 PowerPivot for SharePoint。

雖然 PowerPivot 資料在 Excel 中是以視覺化方式呈現,其實在內部,資料是由 PowerPivot 系統服務從活頁簿擷取的 Analysis Services 多維度資料。

該資料是由 Analysis Services 伺服器執行個體載入伺服器記憶體中,以供在伺服陣列中快速進行資料分析。


安裝前的事項:

(1) 如果您要在 Windows 伺服器作業系統上安裝 Excel 和 PowerPivot for Excel,請加入 NET Framework 3.5.1 功能,然後再加入桌面體驗功能。 加入這些功能之後需要重新開機。

(2) 如果安裝 32 位元版本的 Excel,您必須使用 32 位元版本的 PowerPivot。

(3) 如果安裝 64 位元版本的 Excel,則必須使用 64 位元版本的 PowerPivot。



下載與安裝 PowerPivot for Microsoft® Excel

--03



--04


--05 若是版本不同,將會遇到以下的錯誤:






--06


--07



--08



--09


--10



執行 PowerPivot for Excel

--11


--12


--13



參考資料:

PowerPivot 概念
http://msdn.microsoft.com/zh-tw/library/ee210629.aspx

如何:安裝 PowerPivot for Excel
http://msdn.microsoft.com/zh-tw/library/ee210599.aspx

下載 PowerPivot for Excel
http://www.microsoft.com/downloads/details.aspx?FamilyId=e081c894-e4ab-42df-8c87-4b99c1f3c49b&displaylang=zh-tw

PowerPivot for Excel
http://msdn.microsoft.com/zh-tw/library/ee210644.aspx

在 Excel 中建立 PowerPivot 活頁簿
http://msdn.microsoft.com/zh-tw/library/ee210641.aspx

PowerPivot | Home
http://www.powerpivot.com/index.aspx

PowerPivot | Demo
http://www.powerpivot.com/demo.aspx