Author: Sachin Diwakar

  • DBCC PAGE Command to Analyze SQL Server Database Objects

    One of the most underrated commands, one can find in SQL is DBCC PAGE command. We are saying this not because, the command is not worthy enough to be used, but because it is an undocumented internal command of SQL Server. You will not be able to find much info about this command in online…

  • Interesting Query

    Interesting Query

    Hi Guys! Today one of trainee in my team asked me one strange question, he shows a table and data – Then he asked me to get first 7th id row then 15th id row then 10th id row after this other rows- I tried few queries, Hope this will help you too- Solution1 : select * from…

  • SQL Server Features

    SQL Server Features

    Sql Server 2000 : Version 8 Query analyzer & enterprise manager are separate We can create 65535 databases only Datetime datatype used for both date & time Sql Server 2005 : Version 9 Query analyzer & enterprise manager are combined as SSMS XML datatype is introduced We can create max (2^20-1) databases Ranking functions (Row_Number,…

  • A simple question for you on T-Sql

    A simple question for you on T-Sql

    Hi guys, Today i have a simple question for you & my question is what would be the result of the query- USE tempdb GO CREATE TABLE #Employee (EmpId INT, NAME VARCHAR(15), Salary INT, Expenses VARCHAR(5)) INSERT INTO #Employee SELECT 1056, ‘Viraj’, 230000, 5216 UNION SELECT 2095, ‘Dheeraj’, 98000, 7892 UNION SELECT 7258, ‘Raman’, 42000,…

  • Experiment With Nth Highest Or Lowest Salary Or Record in Sql

    Experiment With Nth Highest Or Lowest Salary Or Record in Sql

    I was reading about it so i searched it on so many blogs & websites. Each blog has described this for employees having unique salaries, but what if few employees have same salary. I am asking this because in an organization few people have same salary structure. Lets understand this with an example- –Create a table and fill…

  • SQL DBA Cheatcode : 15 Things about SQL Server Error logs

    SQL DBA Cheatcode : 15 Things about SQL Server Error logs

    Today I am writing about some good facts about SQL Server Error logs.   SQL Server maintains its own error logs that contain messages describing informational and error events. “Error logs” is just the name but it contains warnings, error, information messages. 1. How to View SQL Server Error Log file location EXEC xp_readerrorlog 0,1,”Logging…

  • SQL DBA Cheatcode : SQL Server properties

    SQL DBA Cheatcode : SQL Server properties

    In this article I am trying to outline about some important server properties which can help you out at the time of auditing and trace history of SQL Server. It has been checked in various SQL versions like SQL 2005, 2008, 2008 R2 and 2012. SELECT SERVERPROPERTY(‘BuildClrVersion’) AS [BuildClrVersion] , SERVERPROPERTY(‘ComputerNamePhysicalNetBIOS’) AS ComputerNamePhysicalNetBIOS , SERVERPROPERTY(‘ServerName’)…

  • Backup of OLAP Database using Powershell

    Backup of OLAP Database using Powershell

    In this article I would like to explain another method to take the backup of OLAP databases via PowerShell. It will help out to take the backup of multiple OLAP databases with a specified retention period. In Tsql, XMLA function is applied however it is a bit puzzling to initiate the similar process for more than…

  • BigData Really…

    BigData Really…

    Hi guys, I was thinking since a long time to write blogs on big data. So, it is my first blog on BIGDATA. As a DBA, I always think where will I be after 5 years or 10 years from now. Should I be a DBA or move to BigData. You may think the same.…

  • PowerShell : Copy a table from one server to another

    PowerShell : Copy a table from one server to another

    In general, a DBA like us gets requests to copy a table data from one SQL Server instance to another. In that case, a DBA first sees the amount of data present in the table and then he decides a method to transfer. Normally, a DBA selects Import Export method or SSIS and of course that is a suggested way to transfer data…

  • Learn Powershell with Vimal Lohani

    Learn Powershell with Vimal Lohani

    Vimal Lohani sharing his knowledge and experience of Powershell in an exclusive series “Introduction to Windows PowerShell” SN Topic Description Posted On 1 Introduction to Windows PowerShell (Part1) Windows PowerShell is a configuration management framework.. June 12, 2015 2 Introduction to Windows PowerShell (Part2) In this session, We will learn how you can control the result.. June…

  • Script : Who deletes the databases?

    Script : Who deletes the databases?

    Hello Readers, Before starting, let me give you some background about this problem. I used to support few servers which had more than 1000 small databases. Worst part was that many users had access to create/delete databases. Many times, other users used to approach me asking “who has deleted my databases” It was a nightmare to…

  • Introduction to Windows PowerShell (Part3)

    Introduction to Windows PowerShell (Part3)

    Hi guys, I am sorry for late due to busy work schedule. But now i am here to fulfill my promise – Today we will discuss about PowerShell scripts & there execution- If you are new to PowerShell Please read previous blogs- Introduction to Windows PowerShell (Part 1) Introduction to Windows PowerShell (Part 2) Lets…

  • How to check SQL Server connection without SSMS?

    How to check SQL Server connection without SSMS?

    There are times when you need to verify SQL Server Connectivity from a machine there is no SQL Server Management Studio or any tool available. Not to worry, there are many ways to do this but the question is how easily can this be done? This question is often asked in DBA Interviews as well, “How to verify…

  • Introduction to Windows PowerShell (Part2)

    Introduction to Windows PowerShell (Part2)

    In this session, We will learn how you can control the result or output of command prompt & will also learn few more commands- If you are new to PowerShell, Please read previous blog Introduction to Windows PowerShell (Part1) You can start from command prompt or from PowerShell- Now Control the result of cmd prompt-  …