Export Data into multiple Excel file- SSIS

Problem Statement:

In a company say ABC Inc. you have stored data in the database for each department. Data includes Location, total salary, # of Paid vacation, and total #of employees for each department. We have a department head for every department and once in every month we need to send these department head's a summary report reflecting this data in an excel file. So our goal is to create different excel reports for each department. [More]

Using Dynamic SQL to Create Database Objects

Say we have a stored procedure that we want to copy across multiple databases. One way would be to create the script and execute in all the databases. But if Databases are many it can be time consuming and efforts to change Database name every time before executing the script will be more. One better way is writing a script that can create the Database object in selected Databases or all Databases at once.
[More]

Order of Execution in SQL Server

In this article we will see the way execution order works in SQL server, mainly when TOP, Union and order by clause are utilized in a query.

Say we have an Employee table

create table Employees

(EmployeeID int identity(1,1) NOT NULL

,EmployeeName varchar(50) NOT NULL default 'N/A'

,Department varchar(50) NOT NULL default 'N/A'

,Salary float NOT NULL default 0) [More]

String Separator in SQL Server

In this article we will see as how we can query the result from relational table when the input parameter is sending data in the form of string separated by a delimiter. [More]

Send Image in Email Body via Database Mail

Certain Business requirements may involve sending database mail that incorporates company's logo, and other formatting things like thick border, particular font etc...Below article describes how this can be done using Database Mail. [More]

Table Valued Parameters

Table Valued Parameters are new to SQL Server 2008. They allow us to pass table variable to stored procedure. The same function can be accomplished by temporary tables, but table valued provide better performance and complete dataset in a table can be passed to stored procedure. [More]

Performance Enhancement and Optimization in SQL Server

In this article, we will see how we can increase the memory of SQL Server that it can use. Usually, default setting is 2147483647 bytes i.e. approximately 2.15 GB that SQL Server can use, but it may be required to increase the ram utilization as some of the query operations can be memory intensive and we want to avoid any Timeouts.

[More]

Send Email to Multiple Recipient using msdb.dbo.sp_send_dbmail

While using msdb.dbo.sp_send_dbmail for sending email, we realize that @receipients parameter takes up only one email address, unless that email address is not pinting to a distribution list all receipient cannot get email. In case we want to accomplish sending email to multiple receipient we can do following: [More]

Import Multiple XML file and parse to tabular data in SQL Server

In this article, we will see as how we can upload the xml file from physical drive and then parse it to tabular data. Our problem statement is say we want to upload the entire xml files that we received in one particular day. [More]

Tags: , , , , , ,

SQL Server | XML

Display all the date from start interval to end interval using Recursive CTE

Suppose we have a given starting date and end date and we need to list all the dates and weekday in that interval. [More]

Tags: ,

SQL Server | SQL Tricks | Recursive CTE