Find SQL Instances – Powershell

DBAs working in data centers would often want to find all the SQL Server instances in the network. How this can be done using few simple powershell scripts? There are multiple ways you can achieve this using powershell. First we just trust the SQL browser services and assume that it… Continue Reading Find SQL Instances – Powershell

CHOOSE() – SQL 2012

I was looking at the the SQL 2012 features and one T-SQL feature that attracted me is CHOOSE. DECLARE @RECORDS TABLE(ID INT IDENTITY(1,1),NAME VARCHAR(10),STATUS INT); INSERT INTO @RECORDS(NAME,STATUS) VALUES (‘A’,1), (‘B’,2), (‘C’,2), (‘D’,3); SELECT *, CASE STATUS WHEN 1 THEN ‘Working’ WHEN 2 THEN ‘Resigned’ WHEN 3 THEN ‘InActive’ END… Continue Reading CHOOSE() – SQL 2012