Skip to content

Instantly share code, notes, and snippets.

@ax4413
Last active August 29, 2015 14:02
Show Gist options
  • Save ax4413/ffc13e1cb0458fe1685f to your computer and use it in GitHub Desktop.
Save ax4413/ffc13e1cb0458fe1685f to your computer and use it in GitHub Desktop.
FULL OUTER JOIN EXCEPT when it doesn't work blog post. Set up file.
DECLARE @T TABLE(Name VARCHAR(128));
INSERT INTO @T
VALUES ('Table1'),
('Table2'),
('table3');
DECLARE @Type TABLE(Name VARCHAR(150), Value VARCHAR(50))
INSERT INTO @Type
VALUES ('bigint','1'),
('binary','1'),
('bit','1'),
('char','1'),
('date','19010101'),
('datetime','19010101'),
('datetime2','19010101'),
('datetimeoffset',NULL),
('decimal','1'),
('float','1'),
('geography',NULL),
('geometry',NULL),
('hierarchyid',NULL),
('image','1'),
('int','1'),
('money','1'),
('nchar','1'),
('ntext','1'),
('numeric','1'),
('nvarchar','1'),
('real','1'),
('smalldatetime','19010101'),
('smallint','1'),
('smallmoney','1'),
('sql_variant','1'),
('sysname','1'),
('text','1'),
('time','00:00:00.000'),
('timestamp','1'),
('tinyint','1'),
('uniqueidentifier','00000000-0000-0000-0000-000000000000'),
('varbinary','1'),
('varchar','1'),
('xml','1');
DECLARE @Left VARCHAR(150) = '[Datbase1].[dbo]'
DECLARE @Right VARCHAR(150) = '[Database2].[dbo]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment