Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mmessano
SQL
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
SQL
Public
Notifications
You must be signed in to change notification settings
Fork
22
(
22
)
Star
36
(
36
)
You must be signed in to star a repository
About
Useful SQL snippets. Mostly for MSSQL
Activity
Stars
36
stars
Watchers
12
watching
Forks
22
forks
Report repository
master
Branches
Tags
Go to file
Code
Open more actions menu
Latest commit
History
11 Commits
11 Commits
Folders and files
Name
Name
Last commit message
Last commit date
CreateIndices.sql
CreateIndices.sql
DBDocumentation_ext_properties.sql
DBDocumentation_ext_properties.sql
DBLevelUserPermissions.sql
DBLevelUserPermissions.sql
DBLevelUserPermissions2.sql
DBLevelUserPermissions2.sql
DMartComponenetExecutionTimes.sql
DMartComponenetExecutionTimes.sql
DMartComponentLoggingPivots.sql
DMartComponentLoggingPivots.sql
DailyStats.sql
DailyStats.sql
DexmaSitesQueries.sql
DexmaSitesQueries.sql
DriveSpace.sql
DriveSpace.sql
Generate_Weekly_Perfmon.sql
Generate_Weekly_Perfmon.sql
IPMonVerificationMaster.sql
IPMonVerificationMaster.sql
IndexMaintenance.sql
IndexMaintenance.sql
IndexMissingNotes.sql
IndexMissingNotes.sql
IndexUsage.sql
IndexUsage.sql
LogShippingTesting.sql
LogShippingTesting.sql
MaintenanceSolution.sql
MaintenanceSolution.sql
OrphanedUserCleanup_bits.sql
OrphanedUserCleanup_bits.sql
ProgressQueries.sql
ProgressQueries.sql
RealECOrdersBy30days.sql
RealECOrdersBy30days.sql
RegExExamples.sql
RegExExamples.sql
ReplicationMonitor_enumeratequery.sql
ReplicationMonitor_enumeratequery.sql
ReplicationMonitor_job.sql
ReplicationMonitor_job.sql
SMCIndexCheck.sql
SMCIndexCheck.sql
SQLErrorLogs_queries.sql
SQLErrorLogs_queries.sql
SQLFilesAudit.sql
SQLFilesAudit.sql
SQLQuery23.sql
SQLQuery23.sql
SQLSpaceStats_bits.sql
SQLSpaceStats_bits.sql
SQLStatsQueries.sql
SQLStatsQueries.sql
SQL_Overview_package.sql
SQL_Overview_package.sql
SSISErrorsEmail.sql
SSISErrorsEmail.sql
ServerDefaultLocations.sql
ServerDefaultLocations.sql
ServerInfo.sql
ServerInfo.sql
ServerInfo_html.sql
ServerInfo_html.sql
TempMigrationTablesToDelete.sql
TempMigrationTablesToDelete.sql
UsefullRegEx.sql
UsefullRegEx.sql
VerifyDBFiles.sql
VerifyDBFiles.sql
VerifyFiles.sql
VerifyFiles.sql
VerifyRRD.sql
VerifyRRD.sql
add_mmessano_db_operator.sql
add_mmessano_db_operator.sql
alter_db_logicalnames.sql
alter_db_logicalnames.sql
attach_db_script.sql
attach_db_script.sql
backupset_queries.sql
backupset_queries.sql
blat.sql
blat.sql
buffer_pool_usage_by_db.sql
buffer_pool_usage_by_db.sql
compare_db_powershell.sql
compare_db_powershell.sql
compare_sprocs.sql
compare_sprocs.sql
compare_tables.sql
compare_tables.sql
create_ScriptTableData.sql
create_ScriptTableData.sql
create_columnlist.sql
create_columnlist.sql
create_db_changeowner.sql
create_db_changeowner.sql
create_db_changeowner_All.sql
create_db_changeowner_All.sql
create_db_dropuser_All.sql
create_db_dropuser_All.sql
cur_sync_users_logins.sql
cur_sync_users_logins.sql
database_execute_permissions.sql
database_execute_permissions.sql
date_manipulation.sql
date_manipulation.sql
daysCTE.sql
daysCTE.sql
dbamaint_create.sql
dbamaint_create.sql
dbm_BackupTranLogs.sql
dbm_BackupTranLogs.sql
dbm_Find.sql
dbm_Find.sql
dbm_ForEachDB.sql
dbm_ForEachDB.sql
dbm_LockTree.sql
dbm_LockTree.sql
dbm_SSAJ_SQL_Server_System_Report.sql
dbm_SSAJ_SQL_Server_System_Report.sql
dbm_get_waitstats_2005.sql
dbm_get_waitstats_2005.sql
dbownertosa.sql
dbownertosa.sql
default_directories.sql
default_directories.sql
dmart_bits.sql
dmart_bits.sql
dmart_bits_IAPPBO510.sql
dmart_bits_IAPPBO510.sql
dmart_bits_PSQLRPT10.sql
dmart_bits_PSQLRPT10.sql
dmart_bits_PSQLRPT24.sql
dmart_bits_PSQLRPT24.sql
dmart_bits_STGSQLDOC710.sql
dmart_bits_STGSQLDOC710.sql
dmart_bits_STGSQLMET620.sql
dmart_bits_STGSQLMET620.sql
drop_SQLErrorLogs_duplicates.sql
drop_SQLErrorLogs_duplicates.sql
drop_dbs_in_norestore.sql
drop_dbs_in_norestore.sql
drop_user.sql
drop_user.sql
enable_DBMail_modified.sql
enable_DBMail_modified.sql
enum_indexes.sql
enum_indexes.sql
enum_permissions.sql
enum_permissions.sql
ex_CTEExample.sql
ex_CTEExample.sql
ex_GROUPBY.sql
ex_GROUPBY.sql
ex_SUMbyColumn.sql
ex_SUMbyColumn.sql
expressmaint.sql
expressmaint.sql
filegroup_location_per_object.sql
filegroup_location_per_object.sql
fix_filenames.sql
fix_filenames.sql
generate_drop_user.sql
generate_drop_user.sql
generate_drop_users.sql
generate_drop_users.sql
index_bits.sql
index_bits.sql
ipmonitor_notes.sql
ipmonitor_notes.sql
jobalertstoDMemail.sql
jobalertstoDMemail.sql
jobownertosa.sql
jobownertosa.sql
ldf_virtuallogfilescount.sql
ldf_virtuallogfilescount.sql
linkedserver_bits.sql
linkedserver_bits.sql
log_statistics.sql
log_statistics.sql
mandelbrot.sql
mandelbrot.sql
perfmon_bits.sql
perfmon_bits.sql
perfmon_bits2.sql
perfmon_bits2.sql
permissions_db.sql
permissions_db.sql
pivot_examples.sql
pivot_examples.sql
pop_perfmon_new.sql
pop_perfmon_new.sql
pr_RebuildIndexes.sql
pr_RebuildIndexes.sql
proc_controller.sql
proc_controller.sql
View all files
About
Useful SQL snippets. Mostly for MSSQL
Activity
Stars
36
stars
Watchers
12
watching
Forks
22
forks
Report repository
Releases
Packages
Contributors
You can’t perform that action at this time.