SQL Server services information

Though there is an option in Windows to get SQL Server services information by typing Services.msc in Start - > Search Programs

From SQL Server 2008R2, DMV is available to get SQL Server services information.

SQL Server XML - Example for adding Namespaces

Recently, my colleague came to me and said he was able to generate XML from relational data.
But he wasn't able to prefix some text before each XML tag.

After seeing his required XML format to be generated, I told him adding namespace will do.

Below is an example for adding multiple namespaces to the XML constructed by the FOR XML query:

--Sample data

DECLARE @StudentInfo TABLE (Id INT, Name VARCHAR(20),Subject VARCHAR(20),Marks INT)
INSERT @StudentInfo SELECT 1,'Sathya','Maths','60'
INSERT @StudentInfo SELECT 2,'Deepak','Maths','80'
--SELECT * FROM @StudentInfo






SSRS - Make common change in multiple reports in one click

Consider a scenario, say if there are more than 100 reports developed already. Each & every report has company logo on header as embedded image. Suddenly, if the company has decided to make minor change in the logo and all the reports needs to be modified with new logo image.

To make common change in multiple reports in one click, we need to create 
  1. Stored procedure 
  2. SSIS package

 Worked Example:

 I have created six sample reports with "SQL Server 2014" image in the header as shown below: