Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PRINT N'Creating TwilightSparkle database'
CREATE DATABASE TwilightSparkle
GO
USE TwilightSparkle
GO
PRINT N'Creating TwilightSparkle objects:'
PRINT N'Creating [dbo].[tblTheSame]'
CREATE TABLE [dbo].[tblTheSame]
(
[Numbers] [int] NULL,
[Words] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spTheSame]'
GO
CREATE PROCEDURE [dbo].[spTheSame]
AS
SELECT Numbers ,
Words
FROM dbo.tblTheSame;
GO
PRINT N'Creating [dbo].[tblOnlyOnTwilightSparkle]'
GO
CREATE TABLE [dbo].[tblOnlyOnTwilightSparkle]
(
[TwilightSparklesSpecialColumn] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spOnlyOnTwilightSparkle]'
GO
CREATE PROCEDURE [dbo].[spOnlyOnTwilightSparkle]
AS
SELECT TwilightSparklesSpecialColumn
FROM dbo.tblOnlyOnTwilightSparkle;
GO
PRINT N'Creating [dbo].[tblOnBothButDifferent]'
GO
CREATE TABLE [dbo].[tblOnBothButDifferent]
(
[Numbers] [int] NULL,
[Words] [nvarchar] (50) NULL,
[SpecialTwilightSparkleColumn] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spOnBothButDifferent]'
GO
CREATE PROCEDURE [dbo].[spOnBothButDifferent]
AS
SELECT Numbers ,
Words ,
SpecialTwilightSparkleColumn
FROM dbo.tblOnBothButDifferent;
GO
PRINT N'Creating Fluttershy database'
CREATE DATABASE Fluttershy
GO
USE Fluttershy
GO
PRINT N'Creating Fluttershy objects:'
PRINT N'Creating [dbo].[tblTheSame]'
CREATE TABLE [dbo].[tblTheSame]
(
[Numbers] [int] NULL,
[Words] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spTheSame]'
GO
CREATE PROCEDURE [dbo].[spTheSame]
AS
SELECT Numbers ,
Words
FROM dbo.tblTheSame;
GO
PRINT N'Creating [dbo].[tblOnlyOnFluttershy]'
GO
CREATE TABLE [dbo].[tblOnlyOnFluttershy]
(
[FluttershysSpecialColumn] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spOnlyOnFluttershy]'
GO
CREATE PROCEDURE [dbo].[spOnlyOnFluttershy]
AS
SELECT FluttershysSpecialColumn
FROM dbo.tblOnlyOnFluttershy;
GO
PRINT N'Creating [dbo].[tblOnBothButDifferent]'
GO
CREATE TABLE [dbo].[tblOnBothButDifferent]
(
[Numbers] [int] NULL,
[Words] [nvarchar] (50) NULL,
[SpecialFluttershyColumn] [nvarchar] (50) NULL
)
GO
PRINT N'Creating [dbo].[spOnBothButDifferent]'
GO
CREATE PROCEDURE [dbo].[spOnBothButDifferent]
AS
SELECT Numbers ,
Words ,
SpecialFluttershyColumn
FROM dbo.tblOnBothButDifferent;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.