2015年4月2日 星期四

SQL SERVER 在執行計畫要查看 實際資料列數目(Actual Number of Rows)

SQL SERVER 如果在執行計畫要查看 實際資料列數目(Actual Number of Rows) 須把Include Actual Execution Plan 勾選 ,這樣才會看的到,
不然若只是 run Display Estimated Execution Plan不會顯示Actual Number of Rows.

2015年1月6日 星期二

SQL Server Operating system error 5: “5(Access is denied.)”

This is Windows related problem where SQL Server does not have appropriate permission to the folder which contains .bak file. The easiest work around that I found was to copy your .bak to default SQL backup location which has all the necessary permissions. You do not need to fiddle with anything. In SQL SERVER 2012, this location is

C:\Program Files\Microsoft SQL Server\MSSQL11.BI\MSSQL\DATA
"MSSQL11.BI" BI是我取的SQL SERVER 名子
預設位置如下
D:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA
把檔案放在此位置 ,在databases按右鍵選擇 Attach 就沒出現問題了

also cna use this script

CREATE DATABASE AdventureWorks2008R2 ON (FILENAME = 'C:\reports\AdventureWorks2008R2_Database\AdventureWorks2008R2_Data.mdf'),
(FILENAME = 'C:\reports\AdventureWorks2008R2_Database\AdventureWorks2008R2_log.ldf') FOR ATTACH;