Script to find SQL Job activity details
Ive written a script to find the job activity details, this script will give the output similar to job activity monitor in SQL2K5 or SQL2K8. In my working place we had a request to collect the job...
View ArticleIP Address Blocking or Restriction in SQL Server
I have seen some questions in forums asking for the answer is it possible to block connections to SQL Server based on IP address. As far as now there is no official way in SQL Server to block the...
View ArticleAdding article to existing publication without generating a full snapshot
This SP can be used to add articles to the existing publication without starting snapshot for all the tables. When Snapshot is started it will create snapshot only for the newly added article to the...
View ArticleChange Transfer Schema for all Objects
In my working environment we will be using different schema for production and development environments. Our development apps are configured to Dev schema and Production apps are configured to Prod...
View ArticleFunction to Split Comma separated string to Integer
There are cases where we need to pass the input parameter to the stored procedure as a comma-separated string in order to avoid multiple db calls from happening. This helps in reducing the db calls...
View ArticleIndex fragmentation Report
I had to prepare the list of tables having more than 60% fragmentation. I wrote this query to get those information. The below query will give the list of all the fragmented tables in a particular...
View ArticleAttach all user databases
I was doing an upgrade of one of our development servers to SQL Server 2008. To minimize the downtime I decided to attach all the user databases using script. Basically, I am attaching the db from the...
View ArticleScript to Check SQL Server Connectivity
Use this VB script to check SQL Server connectivity. You can add N number of SQL Server instances to verify its status. Usage: Download the sqlserverconnectivity.zip file and extract all the files to a...
View ArticleStartup procedure to check SQL Server status when restarted
I’ve written a startup procedure to check SQL Server status when the SQL Server gets restarted. Most of the time as a DBA when a Server gets rebooted or SQL Services is restarted we need to make sure...
View ArticleBatch script to deploy multiple SQL files
I was working on a project where I’m supposed to deploy lots of SQL Server script files (.sql). It’s very tedious job either to manually execute or to write a batch script each time when the deployment...
View Article