TechBubbles

PIVOT & UNPIVOT Operators in SQL Server 2008

PIVOT is a new T-SQL operator introduced in SQL Server 2008 which can be used to rotate rows into columns and can create a crosstab query. You can specify the PIVOT operator in FROM clause of your query.

Using PIVOT

Specify the desired values that you want to see in SELECT statement and FROM clause contains the PIVOT statement. Let us take an example

Read more

Related Posts:

No comments

Date & Time Data Types in SQL Server 2008

The four new data types for storing dates and times in SQL Server 2008 are

  • Date
  • Time
  • DateTime2
  • DateTimeoffset

This post discuss about new date time data types and new date time related functions introduced in SQL Server 2008.

Read more

Related Posts:

No comments

T-SQL TIP in SQL Server 2008

You love this if you write a lot of T-SQL code. This tip I can say as  T-SQL language syntax enhancement. The following are the enhancements in T-SQL

  1. Now We can declare and initialize the variables with single statement.

Read more

Related Posts:

No comments

MERGE Statement in SQL Server 2008

There has been significant T-SQL improvements in SQL Server 2008. This post explores the most notable changes in T-SQL introduced in SQL Server 2008.

The MERGE Statement

As name says, It combines Insert,Update, and Delete operations along with the Select operation which provides the source and target data for merge. In earlier versions, We need to write separate multiple statements to achieve the same.

Read more

Related Posts:

1 comment

Creating an Analysis Services Project in Visual Studio 2008

Microsoft SQL Server Analysis Services allows the developers to provide a unified access of data for analytical analysis and reporting. Developers can manage and aggregate the queries from multiple subject areas. This can be achieved by creating a cube in Visual Studio 2008. This post defines and explains the terms used in creating an analysis project in VS 2008.

Read more

Related Posts:

No comments

Table Expressions in SQL server

Table Expressions are sub-queries where a table is expected. There are two types of table expressions. This post explains how to use the Table expressions and their advantages.

  • Derived tables
  • Common Table Expressions

Read more

Related Posts:

No comments

SQL server Joins or Subqueries?

Select statements that use join operator and join statements can be written in Subqueries and similarly Subqueries can be written in Joins. Writing the Select statements with Join operator can help database engine to find more efficient strategy for retrieving the appropriate data. However each having their own advantage over other. Some problems can be easily solve with Subqueries and some can be solve with Joins. More about SQL Joins can read here.

Read more

Related Posts:

No comments

Report Builder 2.0 in SQL Server 2008

Report builder 2.0 is a report authoring tool that we can use to design and publish reports. We can specify the data source, what data to display on report and which layout you prefer to see the report. When you run the report, the report processor takes all the information you specified and retrieves the data and generates each page as you view it. This post explains step-by-step details of creating the report using Report Builder 2.0.

image

Using Report Builder you can

Read more

Related Posts:

No comments

SSIS Package Configuration in SQL server 2008

SSIS configuration wizard allows you to create configurations for packages. It also allows you to update the properties and objects of the package at run time.

Package Configuration Benefits

  • Configuration really helps the developers to smoothly move the packages from Development environment to Production environment.

         Eg: Configuring the source path of the file or updating the database

              connection string.

  • Configurations makes it easier when you deploy the packages over different sql servers.
  • Using property expressions we can update the value of variable in configuration. More about this can be read here

1. Open the Business Intelligence Development Studio from Start->Programs

    image 

Read more

Related Posts:

1 comment

Creating a SSIS package in VS 2008

This post explains in detail about creating a SSIS package in VS 2008, project folder structure and designer. You can read this post to get understanding on SSIS.

BIDS(Business Intelligence Development Studio) can be found after installing the full version of SQL server 2005 or 2008. I am using the 2008 version for this post. The SSIS development environment is detached from SQL server and you can develop the package offline then can be deployed to the server.

BIDS can be found in the SQL server 2008 group as shown below

image

1. To start a new SSIS project, first you need to open BIDS and select File —-> New —–> Project

image

2. In the solution explorer you will notice an empty package called package.dtsx was created.

image

3. Drag the Execute Process Task to designer from tool box. Double click the task to configure it. Name the task Notepad and browse the file location for executing the task.

4. Drag another Executable Task to designer and double-click on it to open the editor. Name the task calc and browse the exe file for executing the task.

image

These tasks are now connected, and the calc task will not execute until the first task succeeds.

5. Save the project and run it you were able to see the notepad. After closing the notepad you will get the calc. After execution of this package the tasks should show as green in color, which means successfully executed.

If you look into the directory that contains your solution , you were able to see

  • .dtsx – A SSIS package
  • .ds  – A shared data source file
  • .dsv – A data source view
  • dtproj – A SSIS project file

The toolbox will look like the same

image

Related Posts:

2 comments