Hi Guys, Here I am starting How To series, hope it will be helpful for SQL’s lovers.

It’s a daily routine we see system reports where all things like Server health, DB Status, Jobs Status, Disk Spaces … etc. are as per defined standard or not. Hope you guys also worked/managed SSRS – report server also. Hope you have also got queries / complaints from your internal or external clients stating reports are slow / reports are not being generated / reports server is not working / reports are being generated from long time …… etc.
Here is a query, it will show where are problems – is it related to data Retrieval or related to data processing or where it is related to rendering. Below query will show all details

Use ReportServer — Use configured DB Name

SELECT EL.ReportID ‘Report ID’,
CT.name ‘Report Name’,
CT.Path ‘Report Path’,
WHEN EL.RequestType = 0 THEN ‘Interactive’
WHEN EL.RequestType = 1 THEN 
WHEN EL.RequestType = 2 THEN ‘Refresh Cache’ END AS ‘Request Type’,
EL.Format ‘Report Format’,
DATEDIFF(ss,EL.TimeStart,EL.TimeEndAS ‘TotalDuration(Sec)’,
(EL.TimeDataRetrieval/1000.00AS ‘Data Retrieval Time (Sec)’,
(EL.Timeprocessing/1000.00AS ‘Processing Time(Sec)’,
(EL.TimeRendering/1000.00AS ‘Rendering Time(Sec)’,
WHEN EL.Source=2 THEN ‘Cache’
WHEN EL.Source=3 THEN ‘Snapshot’
WHEN EL.Source=4 THEN ‘History’
WHEN EL.Source=5 THEN ‘Ad hoc(Report Builder)’
WHEN EL.Source=6 THEN ‘Session’
WHEN EL.Source=7 THEN ‘Report Definition Customization Extension(RDCE)’
END AS ‘Source’,
EL.ByteCount/1024.00 AS ‘Size(Kb)’,
EL.[RowCount] AS ‘Number of Records’
FROM ExecutionLog EL
INNER JOIN [Catalog] CT ON CT.itemid=EL.reportid
Order by EL.TimeStart Desc

Use it and please share the comments/views/your finding on same – Happy Reading !

It’s very common practice a database administrator guy has two login as WINDOWS authentication and a SQL’s sysadmin at database box. DBA guy always connect DB Server from their own working workstation (Desktop/Laptop) via SQL Server Management Studio (SSMS). Sometimes it happens we have to connect Server from different workstation, in this situation we have to use own windows credential instead of local workstation. To use the different login to connect to SQL Server using SSMS we need to use the “Run as” feature. To do this there are many option, some of few are as,

1)Run As different User :

Just go to at SSMS.exe, Press and Hold the Shift Key and Right Click on the SSMS executable, Now select “Run as Different User” option.
Click on Start Button, Go to SSMS and, Press and Hold the Shift Key and Right Click on the SSMS.
It will be look like as below

It will ask user name and password as below, write Username and password, it will connect to database server with given credential.

2) Run As from Command Prompt :

Just open the command prompt ( Start ->Run->CMD)

At your command prompt, write as

Runas /user:VirendraRnD\Virendra “C:\Program Files\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe”
Runas /user:VirendraRnD\Virendra SSMS.EXE


It will ask password for given user.
Note : SSMS.EXE path may be changed as per your installation or SQL server version. Use RUNAS / NETONLY If the credentials specified are for remote access only.

3)Run As from RUN Command :

Step -1 : Go to Start -> Run,
Step -2 : Type following command in text box and press enter, this will launch command prompt to get user’s password:

Happy Reading, Please suggest other options !

Use of SQL Server Management Studio

Posted: June 29, 2015 by priyankachouhan in SQL General
Tags: ,

SQL Server Management Studio is very important to manage SQL server. It is the collection of graphical tools that will enhance the skills of a developer as well as administrator. SSMS provide the combine features of query analyzer, analysis manager, and enterprise manager into one environment which included last releases of SQL Server. With all these tasks, it works with all the components such as Integration and reporting service.

In this blog we will discuss the following points about SSMS:

  • Features in SSMS
  • Features of Object Explorer
  • Extensibility
  • Template Explorer

Features in SSMS: SQL Server Management Studio includes the several features:

  1. It supports administrative task for the SQL Server.
  2. It has resizable and non-model dialogs that allow the access of multiple tools while a dialog is open to the user.
  3. Activity monitor has the option of automatic refresh and filtering.
  4. Importing and exporting SSMS registration from one Management Studio to another.
  5. It has a scheduling dialog box that allows performing action at later time.
  6. An integrated browser that provides the quick browsing for online help.
  7. Integrated Data Mail Interfaces.
  8. Save or print the deadlock files generated by the profiler, review them later or send to administrators for the review.

Features of Object Explorer: Object Explorer provides a hierarchical user interface to manage and view the object in each instance the SQL Server. It has a details pane which represents a tabular view of instance objects and capability to search for a specific object.

Task of the Object Explorer

  • It simply describes how to open and configure the options of object explorer that defines its behavior.
  • Describes that how to create the connection between object explorer and the instance of database engine, Integration and analysis service.
  • It also describes the way to manage object represented as nodes in object explorer hierarchy.
  • It simply describes the way to run custom reports in SSMS.

Extensibility: SSMS is build upon the isolated shell of Visual Studio which supports extensibility. There are some third party and users that have developed the extensions for SQL Server Management Studio. If these extensibilities do not supported, that means there is an issue with forward/backward compatibility.

Template Explorer: SQL provides the variety of templates and they are structured files that contain SQL script, which helps to create objects in the SQL database. Templates are placed on this location C:\Users, under AppData\Roaming\Microsoft\SQL Server Management Studio\120\Templates.

Benefits of Templates:

  • Templates are available for projects, solutions and various types of code editors.
  • It is available to create the objects like table, databases, and indexes etc.
  • It helps to manage server by creating linked servers, extended properties, roles, logins and templates for analysis Services.
  • Template script with the SSMS that contains parameters which help to customize the code.

These are not only the features of SQL SERVER Management Studio but, it has more excellent features which make SQL Server more reliable and secure.

Hi Guys, Today when I was just doing some R&D with SQL server 2016 CTP2, got a new feature in “SQL Server Import and Export Wizard”. I was just importing a CSV file and got a new feature in advance tab as New, Delete and Suggest Types..

The detail step by step screen snaps as below,

Step 1 – Start “SQL Server Import and Export Wizard”, it will shows welcome screen as

Click on Next

Step 2 – Select Data source as ” Flat File Source” , then Browse CSV file.

Step 3 – Click on Columns, it will display all columns details

 Step 4 – Click on ADVANCEED, it will show advance details, there will be 3 New botton as below, marked in RED.

Step 5 – When click on NEW button, it will be add new column options at current selected column as

Now, rest steps are as previous.


Please share your finding/observations.


Hi Guys, its very surprising morning today, when I opened my mail box in morning, got a subscribed mail from SQL Server Blog’s from technet.com. Its saying Mr. Satya Nadella, CEO of Microsoft, announced SQL Server 2016, an intelligent platform for a mobile first, cloud first world. The next major release of Microsoft’s flagship database and analytics platform provides breakthrough performance for mission critical applications and deeper insights on data across on-premises and cloud. Top capabilities for the release include:

Always Encrypted – a new capability that protects data at rest and in motion
Stretch Database – new technology that lets you dynamically stretch your warm and cold transactional data to Microsoft Azure.
Row-level Security and Dynamic Data Masking
Built-in Advanced Analytics, PolyBase and Mobile BI
Row-level Security and Dynamic Data Masking

In-database analytics – Enhancements to our industry-leading in-memory technologies for real-time analytics on top of breakthrough transactional performance
………………….. and many more…
Always Encrypted

Data security is top of mind, especially for mission critical applications, and SQL Server has been the enterprise database with the fewest security vulnerabilities six years running.  To help customers with data security and compliance when using SQL Server on-premises or in the cloud, SQL Server 2016 introducing Always Encrypted. Always Encrypted, based on technology from Microsoft Research, protects data at rest and in motion. With Always Encrypted, SQL Server can perform operations on encrypted data and best of all, the encryption key resides with the application in the customers trusted environment. Encryption and decryption of data happens transparently inside the application which minimizes the changes that have to be made to existing applications.


Stretch Database

Today, in the Ignite keynote, we can gain the benefits of hyper-scale cloud in the box with new hybrid scenarios including Stretch Database. As core transactional tables grow in size, we may need to archive historical data to lower cost and to maintain fast performance. This unique technology allows us to dynamically stretch our warm and cold transactional data to Microsoft Azure, so our operational data is always at hand, no matter the size, and we benefit from the low cost of using Microsoft Azure.  We can use Always Encrypted with Stretch Database to extend our data in a more secure manner for greater peace of mind.

Real-time Operational Analytics & In-Memory OLTP

Building on our industry leading and proven in-memory technologies, customers will benefit from the combination of real-time operational analytics with blazing fast transactional performance – a first among enterprise vendors.  For In-Memory OLTP, which customers today are using for up to 30x faster transactions than disk based systems, Now we can be able to apply this technology tuned for transactional performance to a significantly greater number of applications as well as benefit from increased concurrency.  With these enhancements, the in-memory columnstore will deliver 100X faster queries with in-memory OLTP for in-memory performance and real-time operational analytics.

Built-in Advanced Analytics, PolyBase and Mobile BI

For deeper insights into data, SQL Server 2016 expands its scope beyond transaction processing, data warehousing and business intelligence to deliver advanced analytics as an additional workload in SQL Server with proven technology from Revolution Analytics.  It will make advanced analytics more accessible and increase performance for our advanced analytic workloads by bringing R processing closer to the data and building advanced analytic capabilities right into SQL Server.  Additionally, PolyBase into SQL Server, expanding the power to extract value from unstructured and structured data using existing T-SQL skills. With this wave, we can then gain faster insights through rich visualizations on many devices including mobile applications on Windows, iOS and Android.

Additional capabilities in SQL Server 2016 include:

  • Additional security enhancements for Row-level Security and Dynamic Data Masking to round out our security investments with Always Encrypted.
  • Improvements to AlwaysOn for more robust availability and disaster recovery with multiple synchronous replicas and secondary load balancing.
  • Native JSON support to offer better performance and support for your many types of your data.
  • SQL Server Enterprise Information Management (EIM) tools and Analysis Services get an upgrade in performance, usability and scalability.
  • Faster hybrid backups, high availability and disaster recovery scenarios to backup and restore your on-premises databases to Azure and place your SQL Server AlwaysOn secondaries in Azure.

In addition, there are many more capabilities coming with SQL Server 2016 that deliver mission critical performance, deeper insights on your data and allow you to reap the benefits of hyper-scale cloud.

SQL Server 2016 can capture, transform, and analyze any data, of any size, at any scale, in its native format —using the tools, languages and frameworks in a trusted environment on-premises and in the cloud.

A vulnerability discovered recently could prove to be the final nail in SSL’s (Secure Socket Layer) coffin. The latest vulnerability to hit SSL, called ‘Factoring attack on RSA-EXPORT Keys’ (or FREAK), is claims to breach as many as 36 percent of all websites trusted by browsers. According to reports, several highly ranked websites, including the likes of FBI and NSA, are vulnerable to the flaw. Microsoft has confirmed that all versions of Windows, which have the implementation of SSL/TLS, are vulnerable to FREAK. This implies that if an enterprise is using Windows operating system, an attack on the network can force all software that uses the Windows Secure Channel component to install weak encryption on the Internet. Although widely adopted, SSL has had a chequered history. Discovered as a means to enable secure transmission between two points, SSL was quickly adopted by the industry to ensure secure data transmission. However, SSL was continually bogged down by vulnerabilities. SSL 2.0 was open to length extension attacks, had no protection for the handshake, and was vulnerable to truncation attacks. When 2.0 version gave way to SSL 3.0 that too had several flaws. In October 2014, researchers from Google identified a flaw in the design of SSL 3.0, which exposed it to a padding attack. Called POODLE, (an acronym for Padding Oracle on Downgraded Legacy Encryption), the attack required only 256 SSL requests to disclose one byte of encrypted information. It was also at the receiving end of Heart bleed bug. Given the large number of flaws in SSL, the PCI SSC (Payment Card Industry Security Standards Council) recently came out with a special bulletin that called for imminent amendments to the PA-DSS (Payment Application Data Security Standard) and PCI DSS (Payment Card Industry Data Security Standard). The bulleting warned the payment card industry members that SSL could no longer be relied upon for data protection. To overcome the shortcomings of SSL, a new protocol called Transport Layer Security (TLS) has come to the fore. Based on open standard, it is not only more extensible but also ensures support in the future. Also, TLS is scalable enough to secure connections on client’s side that have only SSL. The bottom line is that enterprise information technology practitioners can no longer bank on SSL 3.0 for ensuring privacy and protection of your data. It is time you ensured that your websites and browsers moved away from SSL to leverage more modern and state-of-the art security protocols like TLS. Meanwhile, to counter FREAK, OpenSSL has published a patch. Other vendors too are in the midst of issuing patches for plugging the vulnerability.

Source : ITNEXT

Now days, as it’s very common and normal trends, The DB size as 100~150…. n GBs are being considered the normal, and even many databases are crossing the terabyte range. In general practice commonly a DBA or sometime Developer starts backups in one process that take a long time and Database is continuing to grow, this back time will increase accordingly, to reduce the backup time, it’s always suggested take backup in Disk instead of tape in off hours. It’s my personal opinion always take backup to San Disk and then archive it to Tape. Disk capacity is matter because it’s directly proportional to costing/expense and to reduce backup size we can use compression. As we know taking a Full backup is very intensive I/O process as every data page in the database must be read and then written to another file. It’s my personal observation, having multiple physical disks, we can achieve higher I/O rates and complete the backup process more quickly with in addition to writing to multiple files, it is also helpful to write to different physical disks to alleviate the I/O bottleneck.

Here are steps, How to take Backup on multiple disks / multiple files using SSMS.

Step 1) Right Click on Database à Task à Back Up

It will shows screen as

Step 2) Click on Add from Destination section and set there multiple physical disk with multiple files by clicking on ADD button again and again.

And finally suppose we have set 2 disk with 2 files it will show like as below

Step 3) Click on OK, Backup will start with 2 physical disks.

The sample script for this process will be as below,

BACKUP DATABASE [VirendraTest] TO DISK N’C:\VirendraTestOnCdrive.bak’,
DISK = N’E:\VirendraTestOnEdrive.bak’ 
N’VirendraTest-Full Database Backup’SKIP, NOREWIND, NOUNLOADSTATS = 1


Please suggest, your finding.