SSIS - Data Conversion and Derived Column
Scenario:Lets say we have some data in text file that we need to load into our SQL table. We have to perform data conversion on SaleDate and then also have to get previous date from SaleDate to insert...
View ArticleSSIS- Read Variable In Script Component and Generate Sequence Number
Scenario : We got this requirement that we need to read the max Sequence Number value from Table and then generate sequence by adding 1 in Data Flow for our SequenceNumber column.Solution: Step 1:...
View ArticleSSIS- Load Slowly changing dimension ( SCD) Type 1 [ Upsert ]
Scenario: Lets say we have to load a dimension table from text file. Our business Key is SSN. We need to insert new records depending upon values of SSN column, If any new then we need to insert this...
View ArticleSSIS - [How To Use Precedence Constraint]
Scenario: We are loading data from source file to our SQL Server table. After the load we want to send email if number of records loaded are more than 5.Solution:We will be using Precedence Constraint...
View ArticleTSQL - How to Load Slowly Changing Dimension Type 2 ( SCD2) By Using TSQL...
Scenario : Let's say we have dbo.Customer Table in OLTP Database or in Staging Database from which we have to load our Dim.Customer Slowly changing type 2 dimension by using TSQL Merge...
View ArticleTSQL - Add Column To All Tables in a Database [ Cursor Example]
Scenario:Sometime we have requirement that add column in all the tables in Database. Today we have to add CreatedOn column in all the tables if it does not exist in table already.Solution:We will be...
View ArticleSSRS - SSRS Prompts for Credentials Again and Again If Access From Other...
Scenario: I have installed SQL Server 2008 R2 and configured Reporting Server. When I log in to Server, I am able to access reports but when try to browse the reports from other computer/s, It prompts...
View ArticleSSIS - Validate File Name, File Header and Footer Information against...
Scenario:Create a SSIS package that will load cvs files to different tables but before loading we want to validate the Header and read the Footer information. If Header does not match with our header...
View ArticleSSRS - Display Header Row on Each Page
Scenario :We have created a simple detail report. When we preview report it shows header on first page but after that it does not show Header Row. We want to see the Header Row on each page.Solution...
View ArticleTSQL - How To Insert Value In Identity Column Manually
Scenario: We have a dbo.Customer table that has ID as identity column. We need to insert one record in this table with -1 for ID.Solution :We will be using Identity_insert ON and Off to do this as...
View ArticleSSRS - Export SSRS Report To Excel and Name Sheets to Group Values Automatically
Scenario : We have created a SSRS report on which we have Country Name on Each of Page. We want to export this report to Excel but want to create separate Sheet for Each Country Name.Our report look...
View ArticleSSIS - [ Read Excel Cell Value In SSIS ( Execute SQL Task) ]
Scenario : We have an excel file with Sheet1. We need to get the CreatedBy value that exists in C3 Cell. After reading this information we can use against our validation table to find out if it matches...
View ArticleSSIS - [ Read Excel File After Skipping Few Rows ]
Scenario:We have excel file with Sheet1 as shown below. We want to skip first 3 rows as they are only description and start reading from 4th Row. The 4th Row contains Header and rest of them are data...
View ArticleSSIS - Use Variable in Execute SQL Task ( Update Statement )
Scenario : We have saved some value in one of the variable in our SSIS Package, now we need to use this variable in Execute SQL task to update values in Table.Solution : Step 1: Create a variable...
View ArticleSSRS - [ Hide/UnHide Columns and Shrink the Remaining Columns By Using...
Scenario: We have created report as shown below but our users request that they want to have a parameter by using that they should be able to hide the Modified Date and Document Summary columns and...
View ArticleTSQL - Remove Database Name Or Some Text From Stored Procedures [ Cursor...
Scenario: Sometime when developers create stored procedure they use DatabaseName.SchemaName.StoredProcedureName. It works fine as long as the database name stays same but sometime we have to restore...
View ArticleDBA - Script Table/s Definition with Data
Scenario: Sometime we want to move table with data from one server to another server. One way to achieve this by using Generate Script Task in SSMS.Solution :We can use Generate Script Task from SSMS...
View ArticleSSIS - Log Package Execution Time To Audit Table
Scenario: We are in process of creating our SSIS Package, one of the requirement is to Audit the information about package execution to below tableCREATE TABLE dbo.PackageExecutionLog ( PkgID...
View ArticleSSIS - Return Row Count From Execute SQL Task [ Updated and Inserted Row...
Scenario: We have source table (dbo.ClientSource) and destination table (dbo.Client) . We want to insert the new records from Source to Destination and update already existing records by using Execute...
View ArticleSSIS - How To Use Pivot Transformation in SSIS 2012
Scenario: We have a table with four columns (SalePerson, SaleYear, SaleMonth, SaleAmount). We want to pivot this data as shown below by using SSIS.Source Table definition and sample dataCREATE TABLE...
View Article