Posts

Showing posts with the label Schema

Migrate SQLPrompt Snippets to VSCode

 I love snippets; love em. And I have a whole bunch in RedGate SQL Prompt. Now I want to be able to use those in VSCode as well, but boy do I dread having to retype all of them. Solution? Python! First arg is the path where your SQLPrompt snippets are Second arg is the directory where you want it to spit out a "sql.json" file with all your snippets. """ A script to translate sqlprompt snippet files to vscode formatted snippets """ import os import json import glob import io import argparse class SQLPromptPlaceholder :     """Represents the values of a SQLPrompt placeholder"""     def __init__ ( self , name , default_value ):         self . name = name         self . default_value = default_value class SQLPromptSnippet :     """Represents the content of a SQLPrompt snippet"""     @ staticmethod     def from_file ( filename ):         """Generates an instance fr...

Embrace The Non-DBO Schema

I don't know how it is everywhere, but in my experience, custom schemas (i.e. something other than dbo ) have been seldom used, and I think it's a bit of a shame. First, what's wrong with dbo ? Inherently, nothing. But as time passes and databases grow, dbo can become a cluttered place with objects of overlapping interest. Disentangling those objects from one another can be a bit of a pain. What Do Schemas Address? Schemas can help with several things, but in my mind, they boil down to three big ones: Organization Keeping objects that belong in the same "place" together Isolation Making clear delineations between the responsibilities of the objects in the schema Management Differentiating permissions Being able to do operations on a specific subset of objects without having to rely on external documentation or naming conventions How Else Can You Achieve Those Benefits? There are really three ways you can achieve the points from the previou...