Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Scripts by S M profile

   Items 1 to 20 of 20   

Use Of Cursor Vs Simple While Loop

You can eliminate CURSOR many a places using WHILE Loop.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 3 reads

Generate password using PowerShell

If you want to generate temporary passwords, can use my script.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 12 reads

Search a string in a text with number of occurrences

IF you have a long string and if you want to search a specific input string, and number of timeS the string has occurred then it's helps  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 15 reads

Check running SQL Services

Check all the running SQL services in different servers. You can use the details before you start implementing SQL Patch to the servers i.e. if you want to explicitly stop the SQL Services.  Read more...
Rating: |  Discuss |   Briefcase | 640 reads

Check Existence of Server and find Instance Type

Execute the function and pass only the SQL Server Name to check if the SQL Instance is available and if yes, what is the Instance Type.  Read more...
Rating: |  Discuss |   Briefcase | 28 reads

Delete SQL Instancename from default backup location

IF you want to delete the SQL Instance folder of your SQL Named instance after uninstall of your SQL Server Instance, then the script will help you. Note: I did an extra step by using / taking data (INSTALLSHAREDDIR) from your .INI file.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase


By S M 2015/03/23 | Source: | Category: backup related
Rating: |  Discuss |   Briefcase | 1,530 reads

Run a specific query across all servers using powershell

Run a specific query across all servers using powershell  Read more...
Rating: |  Discuss |   Briefcase | 923 reads

Alter database owner to SA from any user details on all user databases

Alter database owner to SA from any other user details against all user databases  Read more...
Rating: |  Discuss |   Briefcase | 1,170 reads

Find no of records in each table in database (against Clustered Index)

If you want to find TotalPages, Usedpages,datapages,totalspaceMB,UsedSpaceMB,DataSpaceMB then can use this query.  Read more...
Rating: |  Discuss |   Briefcase | 1,245 reads

Verify Login SID and Machine SID

This script is to verify which login accounts have SID values that don’t match the correct SID values defined on the machine or in the domain.  Read more...
Rating: |  Discuss |   Briefcase | 1,256 reads

Extracting only Deadlock details from ErrorLog.

If you want to extract only deadlock details, use the script.  Read more...
By S M 2014/12/18 | Source: | Category: deadlock
Rating: |  Discuss |   Briefcase | 1,860 reads

Read all trace file data and print the action performed

If you want to read trace file records from default trace location and want to print to see what are all the activities happened on SQL Server, the query will be helpful for you.  Read more...
Rating: |  Discuss |   Briefcase | 949 reads

Extract SQL Server Key details

Extract SQL Server Name, Instance Name, Service Account details, startMode and ServiceState details with Powershell.  Read more...
By S M 2014/10/27 | Source: | Category: powershell
Rating: |  Discuss |   Briefcase | 1,241 reads

Simple script to list out SPID, Program_name and login details

If you have any requirement where you want to find out all the SPIDs running on a database along with the program/application name of the SPID and the login details. You can run the procedure to get the details very easily.  Read more...
By S M 2014/08/12 | Source: | Category: spid
Rating: |  Discuss |   Briefcase | 1,614 reads

Query to check whether my Full Database Backup is running fine.

The query will help to find whether my database backup to a specific instance of SQL Server is running fine. If HH> 1, this would signify that the backup is running, else this is a failure.  Read more...
By S M 2012/09/13 | Source:
Rating: |  Discuss |   Briefcase | 1,114 reads

Backup Database Size calculation Report - Monthwise

The script helps to calculate the size of the backup of the databases monthwise. This will help to understand the database growth rate from the backup file if we do not have any data collection utility to find the exact details of the DATA File growth.  Read more...
By S M 2012/09/24 | Source:
Rating: |  Discuss |   Briefcase | 1,190 reads

Killing User Connection(session) connected to the Database.

The script will be helpful to kill all the user sessions before performing the refresh of the database.  Read more...
By S M 2011/04/08 | Source: | Category: kill
Rating: |  Discuss |   Briefcase | 2,401 reads

Script: Map Orphan Login and Users

Map the Orphan Login and Users. 
By S M 2011/01/03 | Source: | Category: backup / restore
Rating: |  Discuss |   Briefcase | 2,595 reads
   Items 1 to 20 of 20