Skip to content

Instantly share code, notes, and snippets.

View jdpj518's full-sized avatar

John Parker jdpj518

  • Cincinnati, OH
View GitHub Profile
@jdpj518
jdpj518 / gist:95d423cb920a9ffde9b92010326b6919
Last active October 23, 2025 13:30 — forked from dalenewman/gist:6377911
A T-SQL stored procedure for moving an index from one file group to another. The original script was found at http://blogs.msdn.com/b/ramoji/archive/2008/09/26/how-to-move-existing-indexes-from-one-filegroup-to-another.aspx and updated according to responses found on the same page.
CREATE PROC [dbo].[sp_dba_MoveIndexToFileGroup]
(
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList VARCHAR(MAX),
@IndexName sysname = NULL,
@FileGroupName varchar(100),
@VerboseOutput BIT = 0
) WITH RECOMPILE