Category Archives: Scripting

Dropping a publisher when the distributor is down

Working on a new server, I came across a replication process that had been forgotten about and the pieces were disconnected.  The distributor server/process had been installed on another server and when I went to remove the publisher from the … Continue reading

Posted in I learn something new everyday, Scripting | Leave a comment

Coalesce instead of Max

I was asked to tune a query which was used in an export of registration data. A person registers for an activity and they answer questions about this. This query pulls from 19 tables–one of which is a one to … Continue reading

Posted in I learn something new everyday, Scripting | Leave a comment

Recursive CTE Query

A client came to me and had the similar to data set below. Create Table product ( productid        INT, typeid              INT, typeDesc        VARCHAR(15) ) INSERT INTO product VALUES (1,2,‘Male’), (1,2,‘Female’), (1,3,‘Red’), (1,3,‘Green’), (1,3,‘Blue’), (1,4,‘Small’), (1,4,‘Medium’), (1,4,‘Large’), (2,5,‘Small’), (2,5,‘Medium’), (2,5,‘Large’) They … Continue reading

Posted in Scripting | Tagged | Leave a comment

Powershell in SQL Server

I have yet to really scratch the surface in using Powershell to manage my SQL Server; however, from time to time I have used a powershell script to delete files from the server on an ongoing process.  Because I am … Continue reading

Posted in Scripting | Tagged , | Leave a comment