Skip to main content

Posts

SCD using date- Derive Effective From and Effective To Date using SQL

We can able to maintain old historical and current data (SCD) using the date column. Let me show you people how to write a small query to achieve it. For example, Assume we have a column called currency which has currency values of all the countries and your business needs it to keep it uniform, say convert all currency of different countries to USD, so it will be easy for Business judgement and analysis. For this, let me take an example of Yahoo! Finance . Yahoo! Finance API provides us currency conversion of all country based on time. I am not here going to tell how to pull the data from Yahoo! Finance API, But I am using such data which I pulled to explain how SCD can be achieved. Below is a image, which depicts, the data which we got from Yahoo! Finance. We wanted this to get converted as shown below: Where we wanted to derive Effective_To column, which indicates, from one date to other date, the currency was so & so for a country against USD. ...

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Transaction (Process ID 68) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Transaction (Process ID 68) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction." When you receive this error, Please verify if TABLE LOCK option is ticked in OLEDB Destination table. By Checking the TABLE LOCK option, this error will be resolved.

Load JSON Format Data into SQL Server

Hi All, Many situation when we are pulling the data from website or calling the data through an API, we end up with JSON data. If we needed to load JSON Data into Database, we need to break the JSON data into columns. We will see how to break the JSON data using C#. Consider below JSON Data. {     "requestId":"299f#150942d9c47",    "result":[        {           "id":10357,          "leadId":3032,          "activityDate":"2015-06-16T20:20:36Z",          "activityTypeId":1,          "primaryAttributeValueId":26,          "primaryAttributeValue":"eos-celebration",          "attributes":[   ...

Error 2 System.UnauthorizedAccessException: Access to the path '*:\*******\******\******.dtsx' is denied. at System.IO.__Error.WinIOError(Int32 errorCode,String maybeFullPath) at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes) at Microsoft.DataTransformationServices.Project.DataTransformationsProjectBuilder.BuildIncremental(IOutputWindow outputWindow)

Recently, when one of my team mate created a package in the system dedicated to him and later, deployed it into Server. When we tried to run the package from Server, we got this error. All these days, we never had a problem but suddenly we had this issue as Server was recently updated. "Error 2  System.UnauthorizedAccessException:  Access to the path '*:\*******\******\****** .dtsx' is denied.      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes) at Microsoft.DataTransformationServices.Project.DataTransformationsProjectBuilder.BuildIncremental(IOutputWindow outputWindow)  0 0 " I did a quick research and found out error is due to security limit given to User accessing the server. Solution: Right Click on the Package and Go to Properties. In Properties, Go to Security Tab and Check if the user is given Full Permission....

Classes, Methods, Objects..!!!! How do we relate to real world to understand it

Hello Everyone, Since, I started off my career, I was hearing about classes, Methods, publics, private, objects blab blab and I tried a lot to understand it but somehow I couldn’t get a chance to learn it properly. (I am Electronics and Communication Engineer, LOL) However, now I made one sincere attempt and learnt a bit of it, which I would like to share with you guys who are having trouble in understanding it, as it was with me. Let us get into some story how an organization works and from there, we will try to relate the classes, objects, methods. We all have come across how a Multi-National Company works. Consider for instance, Microsoft Inc. Microsoft is one of the top MNC, anyone would dream to work with. We also know that there are many departments in Microsoft. As example, Data Management team, Licensing Team, Marketing team, Development team, testing team etc. Everyone has their own functionality and work they do is different from each other though all are work...

SQL Server 70-461 Exams fundamental - Part 2 (Tips from Querying from Microsoft SQL Server Training kit by Itzik-Ben-Gan)

 In continuation with my previous blog,  here , we will discuss further more. Table Columns and Rows Usually the table is represented by “Fields” and “Records” which is wrong terminology. Just to improve our standard on SQL, we should refer as “Columns” and “Rows”. “Fields” are interfaces what we have on client applications and “Records” are what we have in files and cursors. Tables are logical and they are represented by Columns and Rows. There is nothing called “NULL Value” as mentioned above, null represents missing value. So we should rather call just NULL instead of saying it “NULL Value”. SQL Engine This is an interesting part of SQL. How the query is processed? Let us answer that in some time. SQL is English like language which uses common terms we use in English but converts into a code later stage. SEQUEL is original format (Structured English Query Language) was coined first but due to trademark dispute with Airline company, it is renamed as ...

SQL Server 70-461 Exams fundamental - Part 1 (Tips from Querying from Microsoft SQL Server Training kit by Itzik-Ben-Gan)

Hello Everybody!!! This time, it is about Microsoft Exam. When I decided to take up Microsoft certification (MCSA) on Business Intelligence 2012 (I was planning from 3 years but was never that serious to write, Lol!! But now I am ready), I came up with training kit by Itzik-Ben-Gan. This book was very helpful for understanding the fundamentals of T-SQL and its architectures. However, for my preparation standpoint view, I am summarizing the tips and points from the book which I believe, going through main points, will help lot of them to get small tips instead of reading entire book before day of exam. So let’s start with SQL….!!! Standard SQL is based on the relational model , which is a mathematical model for data management and manipulations. The word relational is not about 2 tables related but it is from mathematical concept of Set Relation from “Set theory”. Relation in the relational model is called a “Table”. (T-SQL is based on multiset theory than on set th...