Skip to content

ntbosscher/ReRunnable-SQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

ReRunnable-SQL

Takes SQL changes code and wraps each segment in IF EXISTS checks. See Notes for supported queries and format.

run php sql-changes.php

Paste your sql code into the STDIN Something like

	ALTER TABLE [dbo].[MyTBL] ADD CONSTRAINT [FK_MyTBL_AnotherTBL] FOREIGN KEY (
		[SomeID]
	) REFERENCES [dbo].[AnotherTBL] (
		[SomeID]
	);
	GO

	--- next query...

Enter a new line with only a period on it

A .sql file will open with the modified code.

Note

Curently setup for:

  1. FK and PK constraints
  2. DROP and CREATE Table
  3. ALTER single column varchar
  • Built to take queries generated by Open DBDiff
  • Not tested on Windows

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages