Posts

Showing posts from September, 2014

PIVOT TABLE IN SQL

Image
Introduction This is a very simple example of Pivot query for the beginners. We use pivot queries when we need to transform data from row-level to columnar data. Pivot query help us to generate an interactive table that quickly combines and compares large amounts of data. We can rotate its rows and columns to see different summaries of the source data, and we can display the details for areas of interest at a glance. It also help us to generate  Multidimensional reporting. Background This post intends to help T-SQL developers get started with PIVOT queries. Most business applications will need some sort of PIVOT queries and I am sure many of you must have come across pivoting requirements several times in the past.  Using the Code Let us have a table name  Invoice  which has three properties,  InvoiceNumber ,  InvoiceDate ,  InvoiceAmount . Suppose we have several rows input in the table. Our goal is to display the sum of  InvoiceAmount  each month.  Collapse  |  Copy Code SELECT * FR

IMPORT MS ACCESS DATABASE IN SQLSERVER

Image
In this article, we make a database in Microsoft Access and that database is used in SQL Server .  So let's take a look at a practical example of how to import a Microsoft Access database table into SQL Server 2012. The example is developed in SQL Server 2012 using the SQL Server Management Studio.  There are some simple steps to do that as described here. Creating a Empty Database in SQL Server Now Press F8 to open the Object Browser in SQL Server Management Studio and expend it. Database -> right-click-> select New database This would open the " New database " window: Now enter a database name to create a database. Now click on the OK button to create the database. The new database will be shown in the Object Explorer: Creating a Table in Access Database Now open the Microsoft Access database and create a database.  The Access database looks as in the following: Importing Access database in SQL Server Now right-click on the Test database and select the  Import Dat