SkillAgentSearch skills...

Sqlhelpers

Just a bunch of SQL Server migration helper functions

Install / Use

/learn @sliekens/Sqlhelpers
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SQL Helpers

This repository contains T-SQL functions that help migrate databases to newer versions. The functions provide a simple API for checking whether objects exists and whether they have constraints.

Project Goals

My goal is to provide a simplish way to check the state of your database.

Previously, you would write code like this to check if a table exists (and drop it when it does):

IF OBJECT_ID('dbo.Scores', 'U') IS NOT NULL 
  DROP TABLE dbo.Scores;

That's kind of hard to read and even harder to remember. ('U' is for 'Table', duh doy!)

Instead you should be able to write this:

IF TableExists('dbo.Scores')
    DROP TABLE dbo.Scores;

Instalation instructions

Run the scripts from this repository on your database to create the helper functions. When newer versions become available, you can safely update to the latest version by running the new scripts.

Available Functions

Click on a function name to go to its page on the wiki.

View on GitHub
GitHub Stars4
CategoryData
Updated5y ago
Forks1

Languages

PLpgSQL

Security Score

70/100

Audited on Jul 4, 2020

No findings