Ir al contenido principal

Entradas

Mostrando entradas de agosto, 2013

Lightswitch - Open a Web Page

This code show how to open an external web page. Evaluating if is an Desktop or Web Apllication. using System.Runtime.InteropServices.Automation; using System.Windows.Browser; using Microsoft.LightSwitch.Client; using Microsoft.LightSwitch.Threading; var uri = new Uri("http://google.com", UriKind.RelativeOrAbsolute); Dispatchers.Main.BeginInvoke(() => {    try{                          // If is a Desktop application            if (AutomationFactory.IsAvailable){                  var shell = AutomationFactory.CreateObject("Shell.Application");                  shell.ShellExecute(uri.ToString());             }            // If is a Web application              else if (!System.Windows.Application...

BI - SSIS Expressions

Name a File dinamically In connections (as a File) you can change the Output File name using expressions. With the following expression you can named a file according with the actual date. “C:\\Projects\\SSISPersonalTrainer\\EmployeeCount_”+ RIGHT ( “ 0”+(DT_WSTR, 2) Month(GETDATE() ), 2 ) + RIGHT ( “ 0”+(DT_WSTR, 2) Day(GETDATE() ), 2 ) + (DT_WSTR, 4) Year( GETDATE() )+”.txt” Function Getdate() LEFT( (DT_WSTR,30) GETDATE() , 10) E.g: 2015-05-26

BI - Integration Services

Description of the SSIS Toolbox Items Script Task Just do a simple task and you can code some actions like evaluate some variables, also you can evaluate two Script task with AND or OR conditional. File System Task Can do all the actions to interact with a FTP. Execute SQL  You can execute a sql sentence, also you can put the result in a variable or variables. Execute Process Task You can execute an external program like a *.bat where you can send it some parameters Expression Task Evaluate variables with many functions like Round, Sum, Date functions, etc. You can use it in a For Loop Container. Send Mail Task As the name say, you send an email with all the attributes you can imagen. Data Flow The Data Flow Task is used to transfer data from a source to a destination and can transform the data as needed. Data Conversion Transfor the data type, usefull in case of non-unicode to unicode Devived Column  create or replace a column in the data stream Aggregate Rolling up data, wit...

BI - Include a packake as a Job

After did your package, insert as a job in SQL Server Select in Visual Studio -> Save As Go to the file system and copy the file to C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL *You have to put the file in this path if not SQL Server will not be able to read the file. Go to SQL Server Manager  Expand SQL Server Agent Right click in Jobs Select New Job Type a Name Click in Steps Click in New Type a Name In Package select the file *.dtsx In the Tab "Execution options", select "Use 32 bit runtime" Click OK In Jobs do right click and select Start Job at Step Ready!!

BI - Load an Excel File to DB

The purpose is to upload an Excel file into a Database without duplicate information. Install SQL Server Data Tools for Visual Studio 2012 Create a New Project  Type: Integration Services Project Create New Package Menu: Project -> New SSIS Package  Inside the Package In the tab Control Flow , drag a "Data Flow Task" Inside the Data Flow tab, drag the following Items, as the image Excel Source OLE DB Source Sort elements (x2) Mege Join Conditional Split Data Conversion OLE DB Destination Excel Source Double click in the element In Connection Manager, Select "New" and then choose the file path Select the Excel tab  In Columns, select all the items OLE DB Source Double click in the element In Connection Manager, Select "New" and then choose the Server Name and Table Click Ok Select the table where you are comparing the information (is the same table where you are going to store the new data) In Columns, select all the items Click OK SORT Double click in t...

BI - Introduction

Leading Up to Business Intelligence So, exactly what does “business intelligence” mean? The authors could provide a simple, tool-centric definition, but we have decided to give you the context that can help you make the most sense of what BI is, why it’s important, and what forces are driving its popularity. Observations from Steven R. Covey’s book,  The Seven Habits of Highly Effective People , show that an airplane that travels from Boston to Los Angeles is off-course for 90 percent of the journey, but the airplane successfully reaches its destination because the pilot makes continuous course corrections based on instruments that monitor the flight and provide feedback. Much like an airplane, if a company is not steered, it will inevitably be off course more than 90 percent of the time. Most companies have a goal or destination and, to gain necessary business insights, use instruments or measurement tools to help monitor and analyze past, current, and projected future performance...