Hello friends, Many times it happened with me I forgot the instance name of SQL Server. So here is a small trick which will help you in determining the entire running SQL Server instance on your machine. You just need to run a simple command on Command prompt. C:>SQLcmd -L This simple command will provide …
Recently , one of my friends shared that some interviewer asked him a question “How to copy table structure only from a SQL Query?” So, Below is simplest query to copy structure only of a table into another table. SELECT * Into #tmpStudentStructureFROM tblStudentSource WHERE 1= 0 in the above query we want to …
Problem:- One of the most important question comes in our mind what is the cause of slow SQL SERVER. We always struggle with following questions Which is highly CPU consuming query ? Which is highly RAM consuming query ? Who is blocking the transaction ? and many more other performance dragging questions. Believe me …
As we discussed in earlier tips how to take full backup and differential backup now in this tip we will see how to take transaction backup . Before taking transaction backup the first and mandatory condition is that you should have a full backup. Just right click the database and go to backup option …
Friends,We were discussing backup from last few post. Now lets take a look one more feature of backup which is differential backup.Differential backup is backup after last full backup. Before taking Differential backup it is a mandatory condition to take full backup.Differential backup can speed up your recovery process or we can say restore process.In …
In last few tips TIP #64 & TIP #65 we get information how to take backup & How to ensure it can be restore? Now lets me share some more information related to backup. Problem:- Sometimes , we are interested to know when last backup is taken for particular database ? Solution: The first …
Problem:- We have seen last time how to take backup in tip # 64. but sometimes it happened we took backup and we are not able to restore it. It might be corrupted. Now , Next step thought come in our mind how to ensure we took right backup which can be restore. …
Problem:- A good maintenance plan always said to take backup but sometimes it is very difficult to take backup of database just because of space constraint.We take backup but we don’t have enough space available.Solutions: SQL server provided the best way and gave us solution of compressed backup. Now how to take compressed backup let …
There are various functions available in SQL Server and it is good to know all of them you never know when they will be helpful to you. So lets start one by one. 1) LEN :- By the name it is clear that LEN function give length of the parameter For example :- DECLARE …
Problem: Sometimes we may require to convert row data to column. we require pivot view of data. Solution: Lets understand this by an example below I am using a table variable which have few columns like Employee, Amount, Month and year. Lets define and create some sample data here. DECLARE @tblEmployee AS TABLE (Employee …