I had posted a database object comparison script in technet gallery long back. I will be posting more updates here. At present this scripts compares tables, indexes and foreign keys. sample usage : Once you deploy the stored procedure you can just run this command to compare two databases exec… Continue Reading Compare database objects

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

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