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

Scripts by S M

SQLServerCentral.com profile

   Items 1 to 20 of 24    Older >>
 

Query to find the Job Output file location at each job step.

Query to find the Job Output file location at each job step. This helps if you want to find out the location of each output file of jobs to find out whether those are going to the right location.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 17 reads

Extract default & Named Instance from @@servername

Extract default & Named Instance from @@servername. Print all characters before and after \ to find default and named instance name.  Read more...
Rating: |  Discuss |   Briefcase | 531 reads

Check existence of a database

Check Status of a database. It will loop through all databases and will print message if the db is present.  Read more...
Rating: |  Discuss |   Briefcase | 908 reads

READ Data from default Trace

READ Data from default Trace to know when the objects are altered. If no database name is provided, it will run through all the databases.  Read more...
Rating: |  Discuss |   Briefcase | 734 reads

Use Of Cursor Vs Simple While Loop

You can eliminate CURSOR many a places using WHILE Loop.  Read more...
Rating: |  Discuss |   Briefcase | 2,238 reads

Generate password using PowerShell

If you want to generate temporary passwords, can use my script.  Read more...
Rating: |  Discuss |   Briefcase | 714 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: |  Discuss |   Briefcase | 1,099 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 | 1,109 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 | 774 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 | 359 reads

SCRIPT TO DELETE OLDER THAN N' DAYS

/* SCRIPT TO DELETE OLDER THAN N' DAYS BACKUP FROM A DEFAULT BACKUP DIRECTORY. IF DAYS = 0, PROVIDED, IT WILL DELETE ALL BACKUP FILES FROM THE BACKUP LOCATION. */   Read more...
By S M 2015/03/23 | Source: SQLServerCentral.com | Category: backup related
Rating: |  Discuss |   Briefcase | 1,795 reads

Run a specific query across all servers using powershell

Run a specific query across all servers using powershell  Read more...
Rating: |  Discuss |   Briefcase | 1,139 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,207 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,275 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,319 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: SQLServerCentral.com | Category: deadlock
Rating: |  Discuss |   Briefcase | 1,930 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 | 976 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: SQLServerCentral.com | Category: powershell
Rating: |  Discuss |   Briefcase | 1,270 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: SQLServerCentral.com | Category: spid
Rating: |  Discuss |   Briefcase | 1,634 reads
   Items 1 to 20 of 24    Older >>