What is SQL – Structured Query Language

What is SQL or Structured Query Language becomes easier to understand if we look at database systems first. A database is a repository of data vital to the activities that need large amounts of data to be stored. Businesses are examples of such activities. Usually such data is used again and again. That requires the data to be organized and easily accessible. Retrieval or update of such data is required to be accurate. Relational databases allow users to set up flexible search criteria to accurately locate a specific data item. Relational databases organize data as tables of rows and columns. RDBMS lets users create flexible queries and locate data accurately. Query language offers standardized syntax to specify such queries. When found, operations possible on the data using Structured Query Language are:

  • Reading record(s) or parts of them
  • Modifying record and store back
  • Deleting record(s)
  • Others

RDBMS or the relational database management systems use SQL programming language. SQL is a standardized form of proprietary query languages used by the product companies. Structured Query Language is a standard of both ANSI and ISO organizations. Standardization makes migrating easier. Substantial changes to the SQL statements used in an application should not be required when moved to another database.

Many of the database products use SQL. Major, well-known database products available are Oracle, IBM DB2, Microsoft SQL Server, etc. Open source MySQL is a very popular product. Structured Query Language available with each of these products offer the core functions. Unfortunately, these companies implement additional functions. The core functions offer select, insert, create, update, delete and drop, etc. These are really sufficient to implement most operations one needs. SQL of these products coupled with the extensions are known differently. T-SQL is offered by Microsoft in SQL Server product while the Oracle version is called PL/SQL.

Distributed database applications, typically, work with a central database server known as the backend. Client applications communicate with this back-end to retrieve data and manipulate them. These clients issue queries for data with Structured Query Language statements. The database server is then updated with the changed data.

SQL is able to change/modify data in the RDBMS. Besides, it is able to change the structure of the database tables. Structured Query Language statements will let a user create a table, modify it or even entirely delete it. What SQL statements can do with data is insert data into fields in the table. What SQL lets you do is to “select” a specific table for modifications. A SQL “update” command changes the value of a piece (field) of data.

If you need to work with RDBMS applications, the core functions that constitute what is SQL would be easy to learn. There are only a few commands that are used. Learning the syntax of how the command word and associated parameters are used is quite simple too. Even when your application needs to migrate to any other RDBMS, it should not be difficult to manage. Optimization can be implemented through the core SQL first, the product specific extensions can be done as a next step.

Further Reading on SQL:

 

What is ODBC – An Introduction and overview

ODBC is the abbreviation of “Open Database Connectivity”. It is a standard that specifies how an application using data from database will interact with a database. ODBC is a standard adopted by the IT industry. The standard specifies the commands that can be issued irrespective of the actual database product. How database products (both RDBMS and non relational ones) respond to requests for finding data, modifying or editing them as also how the requests are to be made vary from product to product. Open Database Connectivity strives to make the requests from applications the same irrespective of which database product serves the data. Databases, on their part, interpret these requests and process data according to their own internal processes (requests and command syntax) to respond the same way irrespective of its make.

With this kind of standardization, it is possible for any application to write front end that issues the standard requests to databases. This is the front end part of the ODBC standardization/ specification. This makes it possible for any application to issue data requests that will be recognized any ODBC compliant database. In fact, the application with this kind of Open Database Connectivity compliant front end would be transparent to what database is going to supply the data requested by it. The database could be any ODBC compliant product, working on any computer on the network and on any operating environment. Like the application front end needs special code to transform the requests from the application to standardized requests, the database needs a driver that will recognize the Open Database Connectivity requests and transform them to commands in specific syntax and sequence required by the given database. These drivers are, obviously, specific to a database product of a particular company. This driver is installed with the client application, the database could be anywhere on the network. The chain of modules for getting ODBC compliant work done is as follows:

  • Application issues requests to the front-end
  • Front-end (part of ODBC requirements) issues standardized requests
  • Open Database Connectivity driver specific to a database product, issues commands as needed by the product



Database serves up data requested and changed made by application up the same chain. After this ODBC standards have been complied with creating an application with a database, removing the parts and replacing them with another is a simple affair. As long as the standard connections through the front end and the Open Database Connectivity driver are maintained, substituting the database with another or an application with another is as simple as changing the tire in a car. It does not matter if the tire is from Bridgestone, Michelin or something else as long as the dimensions (specs of database) of the tire are similar. One could write monolithic application that has the database as a part of it. The application communicates with the database in its native protocol. This will be alright if there was no need for any change during the lifetime of the application. If there is a change needed, you will need to re-write the application all over again. The flexibility arising from ODBC standardization will be lost entirely.

Related links to ODBC

  1. Open Database Connectivity – MSDN
  2. ODBC – A Technical overview
  3. SQL Server 2012 training
  4. What is an ODBC compliant database

 

SQL Server Management Studio 2012 – What is it?

SQL Server Management Studio or SSMS is a product that is a part of Microsoft’s SQL Server 2012 product and has been available from the time the SQL Server 2005 came out. This is a component that helps manage all the parts of the SQL Server. SQL Server Management Studio 2012 can do the following for all the software modules in the server:

  • Configuring
  • Administering
  • Managing

SSMS is a crucial product and a critical piece in managing the database product; it is necessary to become familiar with the product first. Starting with the SQL Server Management Studio Express studio then seems to be a prudent approach. Getting the express version of the SQL Server, which includes the Management Studio could be downloaded from the Microsoft site. Installing the product should not create any problems. You should invest in a regular version after your team is comfortable with the SQL Server Management Studio 2012.

The SQL server Management Studio is like the control center for the product and helps you manage the features of the major modules of the product. MS has their products available in different configurations. The express version is usually a free product that helps users get familiar with the tool before plunging in into larger configurations that are priced. The SQL Management Studio 2012 product download module includes a complete tutorial. The first step for familiarization should be to study this guide. You are provided an access to the user community. This can help with any queries you may have regarding the product, its installation and configuration.

The SQL Management Studio provides the following features that will help manage the server:

  • A minimal database engine
  • An integrated environment to let you work with the product, and any scripting necessary
  • Data analysis services
  • Reporting services

The Microsoft SSMS 2012 provides an activity monitor. It is possible to schedule actions at different times and to have multiple tool open at the same time. The SQL Server Management Studio can monitor these activities. If you needed an uncluttered and reduced higher level view, it is possible to apply filters.

The SQL Management Studio has an object explorer that can provide access to all types of objects within the server environment. Access to the SQL server agent for administering them in a replicated environment, filtering of schema, name or date is available. The SSMS will let you filter parts of these objects too. Objects inside the database could be populated asynchronously. If necessary, the objects could be filtered with the metadata associated to the objects.

Scripting capabilities keep getting updated with the server version releases. This is supported with templates for quick development; script editing could be off-line, even when disconnected from the server and a source control tool for managing the script sources.

SQL Server Management Studio capabilities could be extended, given the way it is built. However, the Microsoft does not promise any support for extensions users may build. No official documents that may help in such developments are also published. This policy is so strict that when you seek customer support, you need to remove any such extensions if you have any installed.

SQL Server Management Studio – Related Links

 

 

Visual Studio 2008 – An Overview

Visual Studio 2008 is a development system by Microsoft. It is an integrated development environment or IDE. An IDE usually has features that help write code, manage the source code, create the object code, run it and help debug it. Visual Studio 2008 is an IDE that supports several software tools that help is each of these departments. While Visual Studio has many editions, it is from Visual Studio 2008 version that has integration with SQL Server editions, starting with the SQL 2005. There have been several versions after Visual Studio 2008 too. Because of this, connection mentioned, it made sense to study Microsoft Visual Studio 2008. Visual Studio makes available multiple tools for each of the developments, testing, deployment, integration and management of a software system for and given application. Not only, there is a comprehensive set of tool but development across devise type is also supported. Your target device could be the web, a PC, a server or some mobile device.

Visual Studio 2008 integrates tools, servers as well as services. It offers these features to make development and solving related problems relatively easy. So much so that not only experienced developers benefit from it but even beginners are able to get used to the tools and services quite easily. Productivity in development is helped by code editors that are quite efficient. Intellisense feature and wizards help developers manage their development functions. Intellisense is like auto-completion so that code statement’s completion is helped by the system automatically prompting the required parameters. That would avoid mistakes and make code development faster in Microsoft Visual Studio 2008 environment.

Life cycle management support through tools like Visual Studio Team System is available. MS Visual Studio Team system is a team collaboration product. This tool can help developers with work-item tracking and provide a team portal. By tracking the work items, it can manage version control too. Build management, business intelligence and process guidance are other features available through this component of Visual Studio 2008.

Visual Studio 2008 offers the team system that is a combination of products. These are:

  • The architecture edition is helpful in designing a distributed system that is well-designed and can be validated
  • The database edition provides a tool for managing the database and changes made to it
  • Insecure, inefficient or poor-quality code development ca be prevented through the development edition. It provides the means of unit testing
  • Test edition and test load agent modules helps with managing all the testing you need to do.

Visual Studio 2008 is available in two major editions; the standard edition and the professional edition. Microsoft Visual Studio 2008 standard edition provides an integrated environment as described. It is a complete development environment for applications for the web or the Windows.

Visual Studio 2008 Professional edition provides additional features beyond the standard edition. Developing ASP.NET or .NET AJAX based supplications for the web or for the different Windows versions, this tool will let you work with SQL Server databases as also mobile devices. This Visual Studio 2008 Pro version also has unit testing built in to get software modules tested early on. This tool helps integrate Microsoft’s productivity suite easily too.

Microsoft Visual Studio 2008 – Additional Reading

 

 

SQL Server Enterprise edition – SQL Server versions

The Microsoft RDBMS product SQL Server is available in several editions. The most common ones are the Express, Standard and the Enterprise editions. Standard versions of each release will have more features and capabilities than the Express edition. SQL Server Enterprise edition, in turn, has more capability than the standard editions of each release. Depending on the release version of the product, there may be additional editions.

For example, the 2012 release has a business intelligence edition. We shall concentrate on this latest product here, the SQL Server Enterprise edition, 2012. While the Express edition is for familiarization, the SQL Server Enterprise edition is for serious applications like implementing high capability data centers with extensive database and business intelligence solutions.



style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-2139509105511383"
data-ad-slot="3524818420">

Some of the notable features of the SQL Server Enterprise edition 2012 include the following,

  • Data quality services that help profile, clean up and match data ensuring the quality of the data going into the database is dependable
  • Power View or a means for data visualization and exploration by users conveniently
  • Distributed replay features helps testing applications, configurations and upgrades. This can be very handy in SQL Server Enterprise adoption in the organization. A range of free tools are available so that users can be sure of a hassle-free transition to the new version
  • Enhanced audit facility helps flexibility in auditing, and making audit possible in all editions of the product. The audit trail thus created in SQL Server Enterprise helps ensure all activity by authorized people can be tracked
  • SQL Server Enterprise has an AlwaysOn feature that manages higher uptime, quickest possible fail-over and utilization of hardware. The SQL Server AlwaysOn feature has been newly introduced and ensures higher availability and business continuity in case of disasters
  • xVelocity features in the SQL Server Enterprise help in a significant rise in performance in the intended applications of business intelligence and warehousing. xVelocity supports in-memory data processing technologies and can boost performance by a factor of 10 to 100 times.

The huge amounts of data that gets generated today needs to be managed and stored. One never knows what kind of insight is available from the big data collection. Besides the efficient storage and management implemented in SQL Server Enterprise, it ensures the ability to view the data to discern any valuable patterns. An additional tool of Power Pivot in the Power View feature of the SQL Server Enterprise helps users to access and combine data from other sources to derive meaning to data visualizations being made. Support of cleansing of data helps the IT department to ensure BI solutions that are dependable. There will be no need to drill down to low-level data to ensure they are good data.

Whenever a new version of a product arrives on the scene, a question that arises without fail is whether existing users should upgrade. ROI percentage and the time it takes to recoup the investment are good metrics to help you decide. According to a Forrester study commissioned by Microsoft for an upgrade to SQL Server Enterprise 2012 has indicated that ROI percentage is 189%, and the payback time is just one year.

SQL Browser – How does this Windows service help SQL Server?

In most practical installations in organizations, the database is usually arranged in a distributed manner. In this arrangement, several clients over the network communicate with the server hardware. There could, of course, be more than one physical server hardware too. In the simplest configuration, this will be a single instance of the SQL Server. However, in a general situation, there will be multiple instances of SQL server running.

SQL Server is assigned a port number 1433 on which to listen for connection request and transfer data back and forth. The communication with clients is established through a named pipe that connects to this particular port. Problem arises when there are several instances of SQL server is running simultaneously. You need a mechanism to make sure the communications with clients happen systematically, and data is passed back and forth between the requested instance of the server and the specific client, even though there is only one port that could be used even when multiple instances exist. SQL Browser is the tool that manages the set of communications exchanges that are needed between clients and an instance of the SQL SERVER. This SQL Browser mechanism was introduced with the release of the SQL server 2005. SQL Browser has been available in the following releases namely the SQL Server 2008, 2008 r2 and 2012 releases.



style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-2139509105511383"
data-ad-slot="3524818420">

SQL Browser or SQL server browser (the official name) listens on the specified port and provides information about the instances that are in existence within a server. The SQL Browser works as a Window service and is present in the machine all the time. The service is able to browse the list of servers available with id and software version number of each instance. When the request comes the SQL server also connects the client to the right instance of the database. The SQL Browser service helps connect to dedicated administrator connection end point additionally. In the Express version of the databases in 2005 as well as later versions, SQL Browser is not enabled. The configuration manager of the SQL server will help set up the SQL Browser in the server.

The SQL 2008 Browser works the same way across the versions.

  • The default server instance uses the port 1433, and a named pipe named as “\sql\query”. Server administrator can change the defaults through the server configuration manager, of course.
  • Ports are assigned dynamically to the server instances.
  • When the server instance stops, for some reason, and is restarted, this assignment can change.
  • Thus, client would not know which port number to use for communicating.
  • Usually the SQL Server Browser uses port 1434. Initial request from a client is sent to this port. SQL server, on request, passes on the port number and the named pipe that has been assigned to the particular instance when it was started.
  • The client then uses these specific resources to communicate with the right server instance. The SQL Browser service can be started and stopped by the database administrator as needed.

The browser is a necessary tool for real-life situations using multiple database servers with clients distributed on the enterprise network.

If you would like to learn more, check out our page on SQL Server 2012 Training.

Overview of Transact SQL

IBM is credited with introducing the first version of SQL (Structured Query Language). The initial form of the query language from IBM was named SEQUEL and was standardized as the query language for databases. SQL (sometimes pronounced S Q L) is now a standard of both ANSI and ISO organizations.

Transact SQL or T-SQL is the version of SQL that is modified and extended by Microsoft for their product, SQL Server. It was intended to make transactions on SQL Server versions including SQL 2012 easier. Transact SQL introduces extensions in several areas of the standard SQL language. Significant changes introduced help creating procedural programs like stored procedures. SQL by itself is unable to do that. If one were able to write procedural pieces, these extensions will help writing procedural code blocks.

The changes required cover conditional program control statements (if..then blocks), introduction of local variables, string operations and other support functions. These include math functions, data-related functions, etc. Some changes made to the “Update” and “Delete” commands are also parts of these extensions in Transact SQL. TSQL also introduces a bulk insert command (similar to BCP) that helps insert large amounts of data. The modifications made in SQL Server 2012 T-SQL for program control introduces program structures that provide the equivalent of if-then-else like structure, loop control structure like while loop. A “continue” construct helps continue a loop. Other controls include return, wait for a time function, begin and end of a code block, etc. Useful operations like setting initial values to local variables, etc. are available too in transact SQL.


There are also updates to the “delete” and “update” commands in Server 2012 T-SQL is similar. Both have a variation that helps utilize a table “join” functions. A “from” clause can be used with both the commands, and tables joined prior to doing a delete or an update. The “Bulk Insert” helps speed up situations where insertion of date has to be done on many rows. Rather than issuing an “insert “command for every row, you could utilize this bulk form of insert provided in transact SQL to read off data from a file and insert date in consecutive rows.

Detailed discussions on Transact SQL can be found at TechNet site provided by Microsoft. Transact SQL is the means of communicating with Microsoft’s DBMS SQL Server. Applications will need to issue the Transact SQL statements to the database server to interact with the underlying data. There is a whole range of applications that may need to interact with databases through this Server 2012 T-SQL language. When interacting with the database through an application, one needs to take into account a range of issues. For details, you would need to look up documentation available from Microsoft. But, briefly, following are the issues to be taken into account when utilizing transact SQL with your applications. These are:

  • Transact SQL syntax details
  • Query tools and APIs
  • Process of modifying data, locking of records and managing transactions
  • How to handle distributed queries
  • Tutorial on Transact SQL scripts

 

Using SQL Server 2012 Agent to create a Database backup SQL job

If you are a SQL server DBA at your company, scheduling jobs and automating Admin tasks is a common practice in your daily life. Of course as the number of SQL servers and the underlying databases grow, this vital role for a SQL DBA can quickly get out of hand. This is where SQL Server 2012 Agent can come to your rescue.
SQL Agent is a separate service in SQL server 2012 DBMS. It has the ability to setup and schedule automated jobs that can run on a predefined schedule. This can include DBA things like backing up your databases on a regular intervals, running import and export jobs, executing a predefined Transact SQL scripts and even deploying PowerShell commands.

Let’s go ahead and dig deeper into some of these components

A visual representation of the MS SQL Agent is as follows.

sql-server-2012-sql-agent-1

sql-server-2012-sql-agent-1

Create a backup job for Northwind database

We are going to create a backup job for Northwind database using SQL Agent. First make sure the Agent service is running, if not right click on SQL Server Agent and choose Start. Next do this:

Jobs > New Job

You will get a new dialog box. Enter the following info for job:

Name: Backup Northwind
Category: Database Maintenance

Next go to Steps in the left pane. Then click on New in the middle pane. Basically you are creating a job step that will run the backup command for your database.

For Step name type “Run SQL”
Next go ahead and enter the following SQL code:

BACKUP DATABASE [Northwind]
 TO DISK = N'C:\SQLBackups\Nwind.bak' WITH NOFORMAT, INIT, NAME = N'Northwind-Full Database Backup',
 SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10
 GO

You always want to parse the sql code and test it. When we ran out SQL command, we got the following output which means that it WORKS!

11 percent processed.
 21 percent processed.
 31 percent processed.
 41 percent processed.
 51 percent processed.
 61 percent processed.
 71 percent processed.
 81 percent processed.
 91 percent processed.
 Processed 560 pages for database 'Northwind', file 'Northwind' on file 1.
 100 percent processed.
 Processed 2 pages for database 'Northwind', file 'Northwind_log' on file 1.
 BACKUP DATABASE successfully processed 562 pages in 0.410 seconds (10.690 MB/sec).

Here is what the new job step looks like in our SQL Server 2012 Agent instance.

sql-server-2012-agent-job-steps-2

sql-server-2012-agent-job-steps-2

Generally you should enable logging which means track execution of your SQL jobs.

Click on Advanced in the left pane

Go ahead Check Log to table and make sure to select Append output to existing entry in table

This basically will provide forensics (big word for SQL geeks) on job executions as time goes on. Btw you can also write this to a file on a shared drive. I actually prefer that option over the Logging table. Click Ok. We can certainly add alerts and a recurring schedule to this. For now lets go ahead and click OK to finally create the sql job in SQL Server 2012 Agent.

Now we are ready for the million dollar question, is this going to work??

Let’s find out by manually executing this job. Under Jobs folder find Backup Northwind. Right click on it and select

Start job at Step

Since we have only one step, the job should start doing its magic. If you did everything correctly, you should get this nice dialog box.

Of course you never assuming anything as a SQL Server DBA and always verify the results. We are going to browse to the folder location and look for the backup file. Here we go:

 

sql-2012-agent-job-success

sql-2012-agent-job-success

Yep its there, BINGO!

Related topics to SQL Server 2012 Agent

Other important things SQL Server 2012 Agent can do are the following:

Operators: An operator in SQL server is someone who can be notified or alerted when something goes wrong in SQL server. And it can also be used as FYI information when an important SQL job completes.

Alerts: Alerts are notifications. These are customized SQL alerts based on error messages or Severity levels. Think off an alert as a heads-up which can then in turn execute a job or notify an operator.

Proxies: SQL Server 2012 Agent proxies are specific accounts with particular permission so that you can have fine-tune control on your SQL server. This will minimize any related security risks.

Error logs: This is the placeholder for any execution related info that is tied to a SQL server job or its underlying job steps. Basically this keeps a chronological order of all the executions with different messages that get generated as the job is executing. Def helpful for troubleshooting purposes

Delete all the user tables in SQL Server 2012

At times we need to delete all the user tables in a SQL Server 2012 database. Why do we need to do that? This may happen if:

  • The data is used for analysis or reporting
  • You are reloading tables every night via a batch
  • There could be application development or testing
  • We have a need to delete objects for a certain schema

 

So this means we have to keep the database intact, just need to drop the tables. There may be other objects like stored procedures, views, user logins and even SQL jobs associated with the database. How do we do that, I mean keep the database but zap all the user tables. Well there are really two options. One is to do it the “old fashioned” way, delete a table one at a time. The other is more elegant and uses TSQL to delete all the user tables in SQL Server 2012. Since we also belong to the Lazy DBA Association, we are going to use TSQL to achieve the end result. We will be doing the following:

  1. Create a temp table
  2. Insert the list of tables into this temp table
  3. Loop through list of tables and zap them one at a time

Note; Make sure the Referential Integrity is disabled, otherwise this will not work

 

use Northwind_test

–declaration of variables

declare
@init_count int,
@rec_count int,
@total_count int,
@table_name varchar(1000),
@sql_stmt varchar(1000)

–create temp table #tmp_tables, more info in another script

create table #tmp_tables
(id int identity(1,1),
tablename varchar(50)
)

–insert into temp table #tmp_tables

insert into #tmp_tables (tablename)
SELECT TABLE_SCHEMA + ‘.’ + TABLE_NAME
FROM information_schema.tables
where TABLE_TYPE=‘base table’

set @init_count=1
select @total_count=count(*) from #tmp_tables
set @rec_count=@init_count

print @init_count
print @rec_count
print @total_count

–while loop to go through the tables

while @rec_count < @total_count

begin
select @table_name= tablename from #tmp_tables where id=@rec_count
select @sql_stmt=‘drop table ‘ + @table_name
–print @table_name
print @sql_stmt
exec (@sql_stmt)

set @rec_count=@rec_count + 1
end

drop table #tmp_tables
/* Sample output

drop table dbo.Employees
drop table dbo.Categories
drop table dbo.Customers
drop table dbo.Shippers
drop table dbo.Suppliers
drop table dbo.Orders
drop table dbo.Products
drop table dbo.Order Details
drop table dbo.CustomerCustomerDemo
drop table dbo.CustomerDemographics
drop table dbo.Region
drop table dbo.Territories
drop table dbo.EmployeeTerritories
drop table dbo.Customers_All

*/

SQL Server 2012 Analysis Services – An Overview

Microsoft SQL 2012 Analysis Services or SSAS has proved to be a major step for Microsoft for the company has been able to project itself as a leader in the field of voluminous data. It promises new, unique and customized solutions for the clients. Microsoft has released a ODBC driver for MS SQL Server that will be capable of running in a Linux environment, allowing the new version to deal with large amounts of data. PowerView with SSRS allows the users to create and consolidate BI reports from all through the Enterprise.  The new version is also loaded with distributed relay that allows capturing of workload on the production server and playing the same on a different machine. This allows testing of the schema forming the basis, the support packs and hardware under specific conditions.

 

SQL Analysis Services

SQL Analysis Services are a layer of meta data or a semantic model that resides on the top of a data warehouse in a relational database. This is like an extra layer that stores information about how the fact and the dimension tables in SQL Analysis Services are to be joined and how measures are to be aggregated. It can also be said to be a cache that results in speedy reporting. Before we discuss the Analysis Services features available in SQL Server 2012 in detail let us briefly look at what SQL Server 2012 SP1 has to offer.

 

SQL Server 2012 SP1

It supports Power Pivot MS Excel 2013 and SharePoint and it comes with a brand new architecture based on utilization of Excel utilities for querying, refreshing, loading and saving of the data, which are supported outside the SharePoint 2013 farm. The experience of the user is further enhanced through spPowerpivot.msi which is nothing but an installation package for the windows environment.

This is the result of additional features like the PowerPivot Gallery (SSAS) and the management dashboard. It also incorporates latest Analysis Services in the Tabular mode which includes KPI storage and measures; categorization of data; character extensions and hierarchy annotation. SP1 allows specifying the level of compatibility at the time of creating new Tabular model projects.

SQL Server 2012 SSAS in addition to the earlier features is loaded with new features that help in decision making and data analysis. A prominent feature is introduction of enhanced PowerShell Support and replacement of the Analysis Services Unified Dimensional Model with a hybrid BISM model (BI Sematic Model) permitting BI to be experienced in the SQL 2012 Server environment. The article discusses new features of Analysis Services in detail. For achieving better understanding the new features have been clubbed under various headings.

The new features available with SQL Server 2012 SSAS can be clubbed under seven heads:

  1. SQL Server 2012 Instance/Monitoring
  2. Analysis Services Tabular Modeling
  3. SSAS Multidimensional Modeling
  4. PowerPivot for Excel
  5. PowerPivot with SharePoint
  6. SQL Server SSAS 2012 Programmability
  7. Design Tools


Discussing each of the heads and the features that can clubbed under them in detail:

SQL Server 2012 Instance and Server Monitoring

When it comes to new features in Server Instance and Server Monitoring, one of the features is – Availability of 3 analysis services modes. Three server modes Multidimensional and Data Mining which is the default mode, PowerPivot for SharePoint, and Tabular are available for analysis services. The type of solution that is created and deployed depends on the type of server mode. The snapshot illustrated below shows the three deployment modes.

Figure 1: Snapshot illustrating the three deployment modes

In addition to this the xVelocity In-Memory Analytics Engine is available for Tabular Modeling model DBs. Using the in-memory storage it does calculations for collecting the data and manipulating it the moment it is requested.

The next feature that has been added is making available new schema rowsets and a DMV query interface to support the xVelocity engine for data warehousing and latest architecture of SQL Server 2012 PowerPivot service pack 1.

The feature to trace events is yet another important aspect of this version which makes it supportive of the SQL Server Extended Events Framework.

This can be enabled with the help of an XMLA create object script as shown in figure 2 below. For stopping tracing objects, the object has to be deleted using the XMLA delete object script as shown in figure 4 below.

SQL-Server-Analysis-Services-XMLA

Figure 2: XMLA create object script for enabling SQL 2012 Sever Extended Events Framework.

 

SQL-Server-Analysis-Services-XMLA2
Figure 3: XMLA delete object script for stopping SQL Sever Extended Events Framework.

Analysis Services Tabular Modeling

The second head of features are clubbed under Analysis Services Tabular Modeling. The features that are available under this head are – Integration of the Tabular Designer Model with  SQL Server 2012 Data Tools, availability of administrative support for tabular model databases that can be independently on an Analysis Services server. This version also introduces the SSAS Tabular Model Designer Diagram View which displays inter related tables using a graph and allows filtration of columns, hierarchies and measures. Another feature that can be discussed under this head is partitioning of tables into logically partitioned objects allowing processing of each partition independently. There are some excellent features related to security. While allowing definition of the security roles by defining the permissions of various members included in a tabular model it also allows row level security restricting the access to data.

KPIs can be used for analyzing the performance of a variable by using base and target values. Hierarchies that exist in the form of metadata can be used for determining the relationship between columns. These can be made to appear separately from the rest of the columns. This particular version has no restriction in terms of number rows that a table can contain.

Two important features in this version are – The DirectQuery Mode and the DAX. The DirectQuery Mode that is available in this version provides with an option to deploy in tabular projects. This allows the users and the reporting clients to retrieve the data right from a MS SQL 2012 Server. DAX can be used with both PowerPivot Multidimensional Modeling and Tabular Modeling allowing use of statistical functions, search functions and table functions.

SSAS Multidimensional Modeling

The next head under which features of this SSAS release can be clubbed are multidimensional modeling. The release carries a new option where it is possible to remove a limitation on file storing strings allowing the files to grow as big as they can. In the earlier versions the maximum size of this file could be 4 GB at the most. Any file beyond this size would face an error. It does not mean though that there is no limit on the file now but fortunately it is not regarding the size any more but only limited by the count of strings that could be place in this file.

Other important features available in the release is collection of metrics related to resource usage right at the cmd level while processing a query & is known as Resource Usage Reporting for SSAS Multidimensional Databases.

Two more enhancements over the earlier versions that can be clubbed under this head are – the ability to trace events for the purpose of troubleshooting lock related query or problems related to processing and using DistinctCount in order to help in running the process much faster for the operation gets over to the relations DB engine. Queries can run faster in the DistinctCount process if the criterion that has been laid down is fulfilled. The performance improves as a result of the fact that the operations are offloaded and placed on the relational database engine. The optimization process is not available as a default action. Optimization requires that the following conditions be fulfilled – Presence of one partition for every measure group; absence of random shapes in queries and the relational DB engine should be on SQL Server 2005 or a later version.


PowerPivot for Excel

SQL Server 2012 SSAS introduces PowerPivot for Excel. Authors can be added and workbooks published using Excel 2010 in SQL Server 2012 and as mentioned above this release also introduces the DAX functions that allows introduction of new statistical functions.

The next two screen shots display more info about SQL PowerPivot

PowerPivot-for-Excel-SQL-2012

SQL-Analysis-Service-PowerPivot-report

PowerPivot with SharePoint

For the release version 2012, a group of features can be clubbed under the heading PowerPivot SharePoint. This version provides an excellent tool for the purpose of installing PowerPivot SharePoint. The first step that the tool undertakes is to perform a scan and determine if PowerPoint configuration is there so that if not, the necessary steps are provided for deployment of operational server. The release also introduces PowerShell Cmdletss for configuration of PowerPivot SharePoint. By using a combination of SharePoint Cmdletss with the newly introduced PowerShell Cmdletss, a PowerPivot SharePoint can be configured. Another feature under this heading is known as a BI Semantic Connection which provides a HTTP endpoint to Analysis Services DBs deployed on a server in the standalone mode. This release provides an improvement in the administration of PowerPivot SharePoint deployment by addition of extra settings. These help detection of problems in advance.

Another feature that is available is the ability to configure automatic upgrade in PowerPivot SharePoint which ensures that the workbooks in SQL 2008 R2 are always up-to-date in tune with the most recent version. This allows data to be refreshed for SQL Server 2012 PowerPivot SharePoint Server workbooks.

Here is the architecture of PowerPivot SharePoint  with relation to SQL 2012.

SQL-2008-PowerPivot-with-SharePoint

SQL Server 2012 SSAS Programmability

As discussed above the release version 2012 provides DAX functions in both tabular projects and PowerPivot workbooks that are built in the Microsoft SQL Server Data Tools. The release has introduced more than thirty new functions in various categories like statistical, table and search along with security at the level of rows.

Another distinctive and important feature of this version is introduction of PowerShell Cmdlets for AMO enabling navigation, the ability to connect via cmd line, and addition of Analysis Services DBs/databases running on a server in either mode namely Multidimensional Modeling or Tabular Modeling.

This release version also introduces PowerShell Cmdlets for the purpose of configuration of Power Pivot for SharePoint. This can be done by using both SharePoint PowerShell Cmdlets and new ones. A PowerPivot SharePoint installation can be installed through the PowerShell script.

Version 2012 also provides extensions for Automation Management Objects as well as XML for Analysis which are made available in order to provide support for Tabular Modeling and both these types of models use the united BI semantic modeling schema. It helps to utilize different kinds of Application Programming Interfaces. Servers running in either mode can be connected using this feature with the help of Object Linked Database or ADO Multidimensional Modeling.NET.

Last but not least yet another feature which falls in this category of programmability is the CSDL or Conceptual schema definition language which is always useful for representing the tabular model as a response to a query initiated by a client. The nature of the query is such that it can use the schema and the representation for creating visualizations like the Power View. An additional feature to Conceptual schema definition language is the bi: extension which includes various entities, data types and relationships for the tabular models.

Design Tools

In addition to the above, the SQL Server 2012 provides updated provisions SQL Data Tools that can be run in the Visual Studio shell. Tabular and Multidimensional projects are created in the SQL Server 2012 Data Tools and the Visual Studio shell incorporates many IDE enhancements like better readability and maintenance of more than one monitors.

Related links to SQL Server 2012 SSAS

-http://social.technet.microsoft.com/wiki/contents/articles/3735.sql-server-samples-readme.aspx
-http://www.sqlservercurry.com/2009/10/overview-of-sql-server-analysis.html
-http://www.microsoft.com/en-us/sqlserver/solutions-technologies/business-intelligence/analysis.aspx
-http://msdn.microsoft.com/en-us/library/bb522628.aspx

Follow us on: