Sync SSAS Cube From One Environment to Another

Please Execute the Below Mentioned Script in Either the SQL Agent Job or XMLA Script Window or in the SSIS Package using the "Analysis Services Execute DDL Task" - 
<Synchronize xmlns:xsi=""xmlns:xsd=""xmlns="">
ConnectionString>Provider=MSOLAP.6;Data Source=SOURCESERVER; Integrated Security=SSPI;Initial Catalog=SourceCubeName</ConnectionString>
DatabaseID>SourceCubeName </DatabaseID>

XML Data Load Using SSIS Script task C#.Net

XmlDataDocument xmldoc = newXmlDataDocument(); XmlNodeList xmlnode,xmlnode1; int i = 0,j=0; string str = null; string FilePath = Dts.Variables["User::File_Name"].Value.ToString(); int nodecount = 0; FileStream fs = newFileStream(@FilePath, FileMode.Open, FileAccess.Read); xmldoc.Load(fs); xmlnode = xmldoc.GetElementsByTagName("TagName"); xmlnode1 = xmldoc.GetElementsByTagName("AnotherTagName"); nodecount = xmlnode.Count;
for (i = 0; i <= xmlnode.Count - 1; i++) { for (j = 8; j <= xmlnode[i].ChildNodes.Count - 2; j++) { str = xmlnode[i].ChildNodes.Item(0).InnerText.Trim() + "|" + xmlnode[i].ChildNodes.Item(1).InnerText.Trim() + "|" + xmlnode[i].ChildNodes.Item(2).InnerText.Trim() + "|"

List of Columns of a Table in CSV Format

----------------------------------------------------------------------- -- *** User Customisation
-- Set up the name of the table here : SET @TABLE_NAME ='Address' -- Set up the name of the schema here, or just leave set to 'dbo' : SET @SCHEMA_NAME ='dbo'
DECLARE @vvc_ColumnName VARCHAR(128) DECLARE @vvc_ColumnList VARCHAR(MAX)
IF @SCHEMA_NAME ='' BEGIN PRINT'Error : No schema defined!' RETURN END
IFNOTEXISTS(SELECT*FROMsys.tables T JOINsys.schemas S ON T.schema_id=S.schema_id WHERE T.Name=@TABLE_NAME AND BEGIN PRINT'Error : The table '''+@TABLE_NAME+''' in schema '''+         @SCHEMA_NAME+''' does not exist in this database!' RETURN END

Get Directory Structure using Extended Stored Procedure xp_dirtree

Exec xp_dirtree 'C:\Windows' Execution of the above stored procedure will give following result. If you prefer you can insert the data in the temptable and use the same for further use. Here is the quick script which will insert the data into the temptable and retrieve from the same. CREATE TABLE #TempTable (SubdirectoryVARCHAR(512), Depth INT);INSERT INTO #TempTable (Subdirectory,Depth)EXEC xp_dirtree 'C:\Windows'SELECT Subdirectory, DepthFROM #TempTable;DROP TABLE #TempTable;

List Directory Files using T-SQL xp_cmdShell Stored Procedure

Here is a example code showing how to list directory files in a file folder using sql xp_cmdshell procedure.
  id int identity(1,1),
  line nvarchar(1000)

INSERT INTO dirList (line) EXEC xp_cmdshell 'dir C:\SQLDatabases'

SELECT * FROM dirList;
    SUBSTRING(line,1,17) [date],
    SUBSTRING(line,18,19) sizeordir,
    SUBSTRING(line,37,100) name
  FROM dirList
  WHERE id > (
    SELECT MIN(id) FROM dirList WHERE line LIKE '%<DIR>%..%'
  ) AND id < (SELECT MAX(id) - 2 FROM dirList)
  isDirectory = CASE WHEN sizeordir LIKE '%<DIR>%' THEN 1 ELSE 0 END,
  isFile = CASE WHEN sizeordir LIKE '%<DIR>%' THEN 0 ELSE 1 END,
FROM cte
The above t-sql script can be used to list files in directory using sql code.
The isDirectory column and isFile column can be used to distinguish files and folders within the target file folder.

By using recursive sql select statements, it is possi…

Additive, Semi-Additive and Non-Additive Measures

Let us begin with the definition of each which will be followed by examples:

1. Additive measures: These are those specific class of fact measures which can be aggreagated across all dimension and their hieracchy

2. Semi-Additive measures: These are those specific class of fact measures which can be aggreagated across all dimension and their hieracchy except the time dimension

3. Non-additive measures: These are those specific class of fact measures which cannot be aggreagated across all/any dimension and their hieracchy

For example:

A) We have sales may tend to add sales across all quareters to avail the yearly sales..hence this is an example of Additive measure

B) We have stock levels say 1000(qty of Item A) on Monday...I sell 200(qty of Item A) on Tuesday I further sell 300(qty of Item A) on Wednesday...going by basic math On Thursday I should be left with 500(qty of Item A, assuming no inventory has flown in) to obtain current stock level I cannot aggregate the Stock sales…

SQL Server 2008 Integration Services Tasks

SQL Server 2008 Integration Services Tasks SQL Server Integration Services (SSIS) is a Business Intelligence tool used by database developers or administrators to perform extract transform & load (ETL) operations. SSIS has come long way since the early days of Data Transformation Services (DTS) which was initially introduced by Microsoft in SQL Server 7.0. Most database developers and administrators had their first interaction with DTS when using the Import and Export Wizard. The primary objective of DTS was to transform data from an OLEDB data sources to another destination. In SQL Server 2008 Integration Services, there are around 28 different control flow tasks and 11 Maintenance Plan Tasks. This article is the first in a series that will cover all the Control Flow Tasks and Maintenance Plan Tasks in SQL Server 2008 Integration Services. Beginning with an overview of the Control Flow Tasks and Maintenance Plans in SSIS 2008.
Overview of Control Flow Tasks in SSIS
The Control Fl…