SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Add a script

<< Newer    Items 21 to 40 of 3481    Older >>

Database maintenance progress

Often we need to know on which stage is a maintenance operation such as: backup, restore, check database. You can get this information using my script.  Read more...
By Evgeny Garaev 2018/01/17 | Source: SQLServerCentral.com | Category: database maintenance
Rating: |  Discuss |   Briefcase | 323 reads

Insert data into a SQL Server Table using Powershell using Invoke-SQLc

How to insert data into a SQL Server Table using Powershell using Invoke-SQLcmd Commandlet  Read more...
By Vishnu Gupthan 2018/01/24 | Source: SQLServerCentral.com | Category: powershell
Rating: (not yet rated) |  Discuss |   Briefcase | 281 reads

SQL Server Missing Index

SQL Server Missing Index Detail Script 
By Yusuf Kahveci 2018/02/28 | Source: SQLServerCentral.com | Category: performance
Rating: |  Discuss |   Briefcase | 2,478 reads

Get Index Scan Count

Script to get the index scan count and Average Fragmentation(since last restart)  Read more...
By Mohammed Arshad 2018/01/10 | Source: SQLServerCentral.com | Category: indices
Rating: |  Discuss |   Briefcase | 306 reads

String Search

This script performs a smart search against all fields of a database for a given "String." The TSQL checks all columns in all tables for data type appropriateness before performing the search. Works with numeric as well as character data types.  Read more...
By Patrick Slesicki 2018/02/13 | Source: SQLServerCentral.com | Category: string match
Rating: |  Discuss |   Briefcase | 736 reads

Shrink all user database files

Shrink all user database files 
By Khaled Dev 2017/12/29 | Source: SQLServerCentral.com | Category: sql
Rating: |  Discuss |   Briefcase | 320 reads

Simplified maintenance of columnstore indexes

This USP runs a maintenance (REORGANIZE or REBUILD) on columnstore Indexes for a givven table, a schema or a database.  Read more...
By Alexander Parakhnevich 2017/12/27 | Source: SQLServerCentral.com | Category: columnstore
Rating: |  Discuss |   Briefcase | 156 reads

Difference between dates displayed in days, hours, minutes and seconds

Show the difference between two dates (from, to) in format #d HH: MM: SS  Read more...
Rating: |  Discuss |   Briefcase | 334 reads

Powershell Script for regular DBA activities_GenerateScripts

Powershell utility for generating scripts for db tables with / without identity columns.It can also produce scripts for fixed number of rows  Read more...
By Mayank Shukla 2018/01/02 | Source: SQLServerCentral.com | Category: powershell
Rating: |  Discuss |   Briefcase | 454 reads

Trigger Based Change Data capture

This script capture INSERTs / UPDATEs / DELETEs on SQL Server table and logs to single table in JSON Format.  Read more...
By Ankush Parab 2017/12/22 | Source: SQLServerCentral.com | Category: cdc
Rating: |  Discuss |   Briefcase | 287 reads

Reporting by date - DateTrunc

A function to truncate datetimes to month, quarter, hour etc and their multiples for convenient grouping  Read more...
By Mike Tanner 2017/11/21 | Source: SQLServerCentral.com | Category: date manipulation
Rating: |  Discuss |   Briefcase | 323 reads

Read Only access to all databases to a user in a SQL Server Instance

Script to grant a SQL a user read-only access to all the databases in Server instance except the system databases and -- the Log shipped databases(if any : secondary :read-only)   Read more...
By Gaurav Deep Juneja 2017/11/22 | Source: SQLServerCentral.com | Category: security
Rating: |  Discuss |   Briefcase | 303 reads

Delete Change Tracking table data sys.syscommittab

With high transactions table the sys.syscommittab table does not gets deleted properly. Millions of backdated row remains. To delete the sys.syscommittab table below is the script.   Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 194 reads

Logshipping Report

Get Logshipping report only when secondary is more than certain time behind Primary.  Read more...
By Harikumar Mindi 2017/11/14 | Source: SQLServerCentral.com | Category: log shipping
Rating: |  Discuss |   Briefcase | 226 reads

Script to send database consistancy errors

This script will run consistency check on database and send an email notification if it found any consistency errors.  Read more...
By Nisarg Upadhyay 2017/11/03 | Source: SQLServerCentral.com | Category: corruption
Rating: |  Discuss |   Briefcase | 389 reads

SQL Server procedure to script tables

SQL Server procedure to script all tables in a given database to one or individual files on a given path.  Read more...
By Gerrit Mantel 2017/10/09 | Source: SQLServerCentral.com | Category: create table
Rating: (not yet rated) |  Discuss |   Briefcase | 565 reads

Rebuild or recompile all views

Simple script to refresh or recompile your business-level views.  Read more...
By Doug Deneau 2017/10/05 | Source: SQLServerCentral.com | Category: views
Rating: |  Discuss |   Briefcase | 444 reads

Add new Databases to a AG Setup with PowerShell

Some short & sweet PS code to add databases on AG Node 1 to AG Node2 and snap them in.  Read more...
Rating: (not yet rated) |  Discuss |   Briefcase | 193 reads

Get SSAS Tabular Model (2016) Roles using Powershell `

Extract roles from 2016 Tabular Models using Powershell.  
By Thasigan Chetty 2017/09/14 | Source: SQLServerCentral.com | Category: powershell
Rating: (not yet rated) |  Discuss |   Briefcase | 119 reads

SQL Agent jobs that run SSIS packages

Lists the job names and package names for jobs that execute SSIS packages (for packages stored in msdb).  Read more...
By TD Knight 2017/09/13 | Source: SQLServerCentral.com | Category: sql agent
Rating: |  Discuss |   Briefcase | 514 reads
<< Newer    Items 21 to 40 of 3481    Older >>