วันอังคารที่ 10 กรกฎาคม พ.ศ. 2555

SQL Server list Database file name


select d.name as db_name, f.name as file_name, f.filename as logical_filename
from sysaltfiles f
inner join sysdatabases d
on (f.dbid = d.dbid)
order by 1,2


Restart OLAP Service from SSIS package

Reference from http://businessintelligencechronicles.blogspot.com/2009/02/using-ssis-script-task-to-executing.html


Using script task to connect remote server to stop & start mssqlserverOLAPService
Basicly we know command to stop and start olap service via command prompt.

Start -->Run command
Net stop mssqlserverOLAPService   <---- Command to stop
Net start mssqlserverOLAPService   <---- Command to start

In the example he remote to run Calc.exe via Command variable
In my case I create two string Command (Command1 , Command2)
Set Command1 = Net stop mssqlserverOLAPService
Set Command2 = Net start mssqlserverOLAPService


And then seperate  commands into 2 script tasks
1 = Script for stop
2 = Script for start

**Remark If  you SSIS version is 2008 You no need to change anythings except your command.
If you using  SSIS 2005 you need to change a little bit command
from Dts.TaskResult = ScriptResults.Success to be Dts.TaskResult = Dts.result.Success
That's it.



That's work perfectly!!!
Thanks 

วันเสาร์ที่ 7 กรกฎาคม พ.ศ. 2555

วันพุธที่ 4 กรกฎาคม พ.ศ. 2555

OLAP Distinct count measures

Analysis Services Distinct Count Optimization

Refer to : 

http://sqlcat.com/sqlcat/b/technicalnotes/archive/2010/09/20/analysis-services-distinct-count-optimization-using-solid-state-devices.aspx


วันศุกร์ที่ 22 มิถุนายน พ.ศ. 2555

View percentage for SQL task

SELECT percent_complete , (estimated_completion_time/1000)/60 Estimated_completion_time_Mins ,
 (total_elapsed_time/1000)/60 Total_Elapsed_Time_Mins ,DB_NAME(Database_id) DBName ,*
FROM sys.dm_exec_requests
WHERE percent_complete <> 0