sql-scripts
sql-scripts copied to clipboard
Repo for Microsoft SQL Server scripts. These are targeted at both DBAs/admins and at database developers.
This code seems to have a bug. If you dump the Defrag log, you will see that sometimes the Index Name and the SQL to rebuild or reorganize that index...
Hi, I recently got the error "String or binary data would be truncated." while executing dba_indexDefrag_sp . This is because the log, status and exclusion tables (plus some variables) have...
Hi, I got the error in the subject line a few weeks back. It might be applicable to others that have the same issue. In my case it's because I...
I am seeing the exception: ``` Looping through our list of databases and checking for fragmentation... ... working on DBNAME... Violation of PRIMARY KEY constraint 'PK_indexDefragStatus_v40'. Cannot insert duplicate key...
ColumnStore Index dissallow SORT_IN_TEMPDB parameter, so in order to rebuild these index, when the @sort_in_tempdb variable is set to 0 then no more SORT_IN_TEMPDB=OFF --> the ELSE part is removed.
We encountered an issue where the script will become "stuck" if the next index to work on has been deleted, or it's associated table has been deleted. We run the...