Monthly Archives: May 2013

SQL Script to parse the FullName field to individual components- part 2

In this post I would like to focus on names which are in the following format: Tendulkar, Sachin Tendulkar ,Sachin Tendulkar, Sachin R and i want to select only first names which are below and in the below format where … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , | Leave a comment

SQL Script to parse the FullName field to individual components- part 1

Often DBA’s get requests to identify count of unique firstnames from a name column. Here is one such request that I received. Here is the situation: I have a column named name and it has the names in the below … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , | Leave a comment

SQL Server Trigger to prevent duplicate inserts

Often the dba’s get requests to code triggers that prevent duplicate inserts into a sql server table. Here is the trigger script that will prevent the duplicate inserts. Hope this helps!

Posted in SQL Server DBA Stuff | Tagged , , , , | Leave a comment

SQL Script to move distribution database from one drive to another drive

First we need to stop the Log Reader Agent and Distribution Agent.For stopping the log reader agent, expand publisher and right click on the publication and view log reader agent status and click stop. Take the distribution database offline from … Continue reading

Posted in SQL Server DBA Stuff | Tagged , , , , , , , , | 1 Comment