{"id":18986050,"url":"https://github.com/deanpdx/sql-fileizer","last_synced_at":"2025-06-12T18:06:37.115Z","repository":{"id":95101914,"uuid":"123737478","full_name":"DeanPDX/sql-fileizer","owner":"DeanPDX","description":"A utility for SQL to avoid repetitive tasks","archived":false,"fork":false,"pushed_at":"2019-03-25T16:35:12.000Z","size":29,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T12:46:07.556Z","etag":null,"topics":["database","mssql","sql","utility"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeanPDX.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-03T22:39:54.000Z","updated_at":"2019-03-25T16:35:13.000Z","dependencies_parsed_at":"2023-03-09T11:00:29.308Z","dependency_job_id":null,"html_url":"https://github.com/DeanPDX/sql-fileizer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fsql-fileizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fsql-fileizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fsql-fileizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeanPDX%2Fsql-fileizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeanPDX","download_url":"https://codeload.github.com/DeanPDX/sql-fileizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239994005,"owners_count":19730780,"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","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":["database","mssql","sql","utility"],"created_at":"2024-11-08T16:29:22.655Z","updated_at":"2025-02-21T10:16:31.364Z","avatar_url":"https://github.com/DeanPDX.png","language":"C#","readme":"# sql-fileizer\nThis is a tool mainly for internal use to avoid repetitive SQL tasks. Currently only supporting `MSSQL`.\n\n## Getting Started\nFirst, make sure you have .NET Core and Git installed. Type `dotnet --version` and `git --version` if you are unsure about your current environment. Assuming you have both tools installed, next clone the repo and run it. To do that, execute the following commands in your terminal:\n\n```\ngit clone https://github.com/DeanPDX/sql-fileizer.git\ncd sql-fileizer\ndotnet restore\ndotnet run\n```\nOnce you run it, you should be greeted with this:\n```\n  _____  ____  _        ______ _ _      _\n / ____|/ __ \\| |      |  ____(_) |    (_)\n| (___ | |  | | |      | |__   _| | ___ _ _______ _ __\n \\___ \\| |  | | |      |  __| | | |/ _ \\ |_  / _ \\ '__|\n ____) | |__| | |____  | |    | | |  __/ |/ /  __/ |\n|_____/ \\___\\_\\______| |_|    |_|_|\\___|_/___\\___|_|\n\nWelcome to the SQL Fileizer! Press \"q\" to quit.\n\nAvailable commands:\n\n1) Display help text\n2) Generate sample config file to be used for option 3\n3) Generate sql files from results of SQL query specified in config file\n4) Generate sql files from stored procs (you will be asked for connection string)\n5) Generate sql files from views (you will be asked for connection string)\n6) Generate sql files from functions (you will be asked for connection string)\n7) Generate sql files from triggers (you will be asked for connection string)\n8) Generate sql files from stored procs, functions, views and triggers (you will be asked for connection string)\n```\nRead on for more information on the various commands.\n## Commands\n### Display help text\nThere isn't much here yet. I am planning on adding non-interactive support at which point this command will become a lot more useful.\n\n### Interactively generate sql files from stored procs\nIt happens semi-frequently that I have to update/maintain old applications along with their databases. As part of our DB build process, we like to drop/create all procs. `sql-fileizer` allows you to quickly create one file per proc and add `drop if exists` logic to them. This can help facilitate the DB build step described.\n\nSelect `Generate sql files from stored procs`. Provide a connection string, subfolder, and indicate whether or not you want to add `drop if exists`. You will end up with one file per proc in `\u003ccurrent-directory\u003e\\\u003csubfolder-name\u003e\\`.\n\nIf you opted to add `drop if exists`, this is what it will look like in each file:\n\n```sql\nIF OBJECT_ID('{0}.{1}') IS NOT NULL\nBEGIN\n\tDROP PROCEDURE\t[{0}].[{1}]\nEND\ngo\n```\nWhere `{0}` is schema name and `{1}` is table name.\n\n### Generate sample config file to be used for step 4\nThe app will create a config file named `config.xml` for you to customize. The default config file will [generate scripts from stored procedures](SampleConfigs/ScriptsFromProcs.xml). See [Sample Configs](SampleConfigs) for more information and additional config files to get you started.\n\n### Generate sql files from results of SQL query specified in config file\nYou will be asked for the name of your config file, then the app will generate files based on the SQL specified in the config file.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Fsql-fileizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanpdx%2Fsql-fileizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanpdx%2Fsql-fileizer/lists"}