{"id":14069836,"url":"https://github.com/Phil-Factor/SQL-Utility-Routines","last_synced_at":"2025-07-30T06:33:01.743Z","repository":{"id":52493163,"uuid":"513165943","full_name":"Phil-Factor/SQL-Utility-Routines","owner":"Phil-Factor","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-11T13:32:01.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T11:37:59.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Phil-Factor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-12T14:02:55.000Z","updated_at":"2024-06-18T00:15:55.000Z","dependencies_parsed_at":"2022-08-31T15:10:45.064Z","dependency_job_id":null,"html_url":"https://github.com/Phil-Factor/SQL-Utility-Routines","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Phil-Factor/SQL-Utility-Routines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phil-Factor%2FSQL-Utility-Routines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phil-Factor%2FSQL-Utility-Routines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phil-Factor%2FSQL-Utility-Routines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phil-Factor%2FSQL-Utility-Routines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Phil-Factor","download_url":"https://codeload.github.com/Phil-Factor/SQL-Utility-Routines/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phil-Factor%2FSQL-Utility-Routines/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267822893,"owners_count":24149716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-13T07:07:16.836Z","updated_at":"2025-07-30T06:33:01.456Z","avatar_url":"https://github.com/Phil-Factor.png","language":"TSQL","funding_links":[],"categories":["TSQL"],"sub_categories":[],"readme":"# SQL-Utility-Routines\n\n### PROCEDURE DropAllObjects\n\nThis is a procedure that deletes an entire database. Before using it please make sure that everything is backed up. It assumes that the login that uses the procedure has the rights to drop database objects. \n\nThis is used for clean out tests while leaving the database itself ready for the next build. As it is used normally with Flyway, it does not drop the schemas. It works by calculating the dependencies that would otherwise cause an error, and drops all objects in dependency order. It was inspired by Adventureworks, that has a clever dependency of a table on a function, thereby defeating all the normal tricks of deleting databases.\n\nThe procedure will drop itself \nInitial creation Date: Friday, 17 June 2022\nExample:\n\n`execute DropAllObjects`\n\n### Table-valued FUNCTION dbo.SchemaObjects\n\nReturns the full names, names, path and comments/documentation of all the schema objects, their name, path, comments (Extended properties) and so on.  This is normally used for full searches of a database.\n\nInitial creation Date: Tuesday, 28 June 2022\n\nExamples:\n\n   - `Select * from SchemaObjects() order by path`\n   - `Select  Name, path, Comment from SchemaObjects() `\n     ` where Name+comment like '%credit%' order by path`\n   - `Select  Name, path, Comment from SchemaObjects() `\n     ` where path like '%person.table.businessentity.%'`\n   - `Select  Name, path, Comment from SchemaObjects() `\n  ` where path like '%.foreign_key_constraint.%'Returns: \u003e`\n\n### VIEW The_Metadata\n\n This is a that lists all of all the database-level attributes and schema-based objects  of the current database to allow a comprehensive search This references FUNCTION dbo.SchemaObjects which needs to be created first.\n\nInitial creation Date: Tuesday, 28 June 2022\n\nExamples:\n\n- `Select Name, Path, Comment from The_Metadata where name+' '+comment like '%credit%' order by path`\n- `Select * from The_Metadata where path like '$.Attributes%'` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhil-Factor%2FSQL-Utility-Routines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPhil-Factor%2FSQL-Utility-Routines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPhil-Factor%2FSQL-Utility-Routines/lists"}