SQL Multi Script 1

Worked example

This worked example demonstrates how to use SQL Multi Script to create and query three databases.

In this example, the Magic Ratchet Company is deploying a SQL Server database to run on their live Web server. In addition to the live database, the company want two identical copies of the live database that they will use for development and testing.

This example has four steps:

  1. Create databases

    Add databases to execute scripts against.
  2. Create the schema and populate the databases

    Set up a distribution list of databases, then execute scripts.

1. Create scripts

You can follow the example on your own system. You will need access to a SQL Server. Note that this example uses SQL Server 2005; if you are using SQL Server 2000, you can follow the example, but you will see slightly different results.

The first step is to add the scripts for this example to the list of scripts that SQL Multi Script can execute. We are going to do this by creating new scripts in SQL Multi Script.

  1. Ensure that script1.sql is selected, then click expand source below to open the first script.

    -- Drop if exist
    if @@trancount > 0 begin rollback end
    use tempdb
    go
    IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'RatchetTest')
    	DROP DATABASE [RatchetTest]
    GO
    IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'RatchetLive')
    	DROP DATABASE [RatchetLive]
    GO
    IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'RatchetDev')
    	DROP DATABASE RatchetDev
    
    GO
    --Create the databases
    CREATE DATABASE RatchetTest
    CREATE DATABASE RatchetLive
    CREATE DATABASE RatchetDev
  2. Copy the script and paste it into the Script pane in SQL Multi Script.
  3. Right-click on the new script in the list, then select Save As, and save the script as SMS_CreateDatabases.sql.
  4. Repeat these steps to create and save the following three scripts:
    • SMS_CreateSchema.sql - click expand source below for the script to copy

      SET ARITHABORT ON 
      SET ANSI_NULLS ON 
      SET QUOTED_IDENTIFIER ON
      
      GO
      
      --Create database structure
      
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'RatchetPriceList')
      	DROP VIEW RatchetPriceList
      
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'RatchetDescriptions')
      	DROP TABLE RatchetDescriptions
      GO	
      CREATE TABLE [dbo].[RatchetDescriptions] (
       [RatchetID] [int] NOT NULL ,
       [ShortDescription] nvarchar(2000) NULL ,
       [Description] [text] NULL ,
       [Picture] [image] NULL 
      ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
      GO
       
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'RatchetPrices')
      	DROP TABLE RatchetPrices
      GO	
      CREATE TABLE [dbo].[RatchetPrices] (
       [RecordID] [int] IDENTITY (1, 1) NOT NULL ,
       [RatchetID] [int] NULL ,
       [Price] [money] NULL ,
       [DateValidFrom] [datetime] NULL ,
       [DateValidTo] [datetime] NULL ,
       [Active] [char] (1) NULL 
      ) ON [PRIMARY]
      GO
       
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'RatchetReferences')
      	DROP TABLE RatchetReferences
      GO 
      CREATE TABLE [dbo].[RatchetReferences] (
       [RatchetID] [int] NOT NULL ,
       [Reference] [varchar] (50) NULL 
      ) ON [PRIMARY]
      GO
       
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'Ratchets')
      	DROP TABLE Ratchets
      GO
      CREATE TABLE [dbo].[Ratchets] (
       [RecordID] [int] IDENTITY (1, 1) NOT NULL ,
       [Description] [varchar] (50) NULL ,
       [SKU] [varchar] (20) NULL 
      ) ON [PRIMARY]
      GO
      
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'RatchetPurchases')
      	DROP TABLE RatchetPurchases
      GO
      CREATE TABLE [dbo].[RatchetPurchases] (
       [PurchaseID] [int] IDENTITY (1, 1) NOT NULL ,
       [RatchetPriceID] [int] NOT NULL ,
       [Quantity] [int] NOT NULL DEFAULT (1) ,
       [InvoiceNumber] [nvarchar] (20) NULL ,
       [Date] [datetime] NOT NULL DEFAULT (getdate())
      )
      GO
       
       
      IF EXISTS(SELECT name FROM sysobjects WHERE name = 'Contacts')
      	DROP TABLE Contacts
      GO
      CREATE TABLE [dbo].[Contacts] (
       [ID] [int] IDENTITY (1, 1) NOT NULL ,
       [Name] [nvarchar](100) NOT NULL ,
       [PhoneWork] [nvarchar](25) NULL ,
       [PhoneMobile] [nvarchar](25) NULL ,
       [Address1] [nvarchar](128) NULL ,
       [Address2] [nvarchar](128) NULL ,
       [Address3] [nvarchar](128) NULL ,
       [JoiningDate] [datetime] NULL DEFAULT (getdate()),
       [Email] [nvarchar](256) NULL
      )
      GO
      
      ALTER TABLE [dbo].[RatchetDescriptions] WITH NOCHECK ADD 
       CONSTRAINT [PK_RatchetDescriptions] PRIMARY KEY  CLUSTERED 
       (
        [RatchetID]
       )  ON [PRIMARY] 
      GO
       
      ALTER TABLE [dbo].[RatchetPrices] WITH NOCHECK ADD 
       CONSTRAINT [DF_RatchetPrices_DateValidFrom] DEFAULT (getdate()) FOR [DateValidFrom],
       CONSTRAINT [DF_RatchetPrices_Active] DEFAULT ('N') FOR [Active],
       CONSTRAINT [PK_RatchetPrices] PRIMARY KEY  NONCLUSTERED 
       (
        [RecordID]
       )  ON [PRIMARY] 
      GO
       
      ALTER TABLE [dbo].[RatchetReferences] WITH NOCHECK ADD 
       CONSTRAINT [PK_RatchetReferences] PRIMARY KEY  NONCLUSTERED 
       (
        [RatchetID]
       )  ON [PRIMARY] 
      GO
       
      ALTER TABLE [dbo].[Ratchets] WITH NOCHECK ADD 
       CONSTRAINT [PK_Ratchets] PRIMARY KEY  NONCLUSTERED 
       (
        [RecordID]
       )  ON [PRIMARY] 
      GO
       
      ALTER TABLE [dbo].[Contacts] WITH NOCHECK ADD
       CONSTRAINT [PK_Contacts] PRIMARY KEY CLUSTERED
       (
        [ID]
       )
      GO
      
       CREATE  INDEX [IX_RatchetPrices] ON [dbo].[RatchetPrices]([RatchetID]) ON [PRIMARY]
      GO
       
       CREATE  INDEX [IX_RatchetPrices_1] ON [dbo].[RatchetPrices]([DateValidFrom]) ON [PRIMARY]
      GO
       
       CREATE  INDEX [IX_RatchetPrices_2] ON [dbo].[RatchetPrices]([DateValidTo]) ON [PRIMARY]
      GO
      
       CREATE UNIQUE CLUSTERED INDEX [IX_RatchetPurchases] ON [dbo].[RatchetPurchases]([PurchaseID]) ON [PRIMARY]
      GO
      
      -- Create indexed view
      GO
      CREATE VIEW dbo.RatchetPriceList
      WITH SCHEMABINDING 
      AS
      SELECT     dbo.Ratchets.RecordID, dbo.Ratchets.Description AS Ratchet, dbo.RatchetPrices.Price
      FROM       dbo.Ratchets INNER JOIN
                 dbo.RatchetPrices ON dbo.Ratchets.RecordID = dbo.RatchetPrices.RecordID
      GO
      
      CREATE UNIQUE CLUSTERED INDEX [IX_RatchetPriceList] ON [dbo].[RatchetPriceList] ([RecordID])
      GO
    • SMS_InsertData.sql - click expand source below for the script to copy

       --Deploy data
      
      BEGIN TRANSACTION
      SET IDENTITY_INSERT [dbo].[Ratchets] ON
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (1, 'Red Ratchet', 'RW')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (2, 'Extended Ratchet2', 'EW')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (3, 'Dark Ratchet', 'DW')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (4, 'Grow-your-own Ratchet', 'GW')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (5, 'Ratchet access kit', 'AW')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (6, 'Test kit', 'TK')
      INSERT INTO [dbo].[Ratchets] ([RecordID], [Description], [SKU]) VALUES (7, 'Exploded Ratchet diagram', 'ED')
      SET IDENTITY_INSERT [dbo].[Ratchets] OFF
      INSERT INTO [dbo].[RatchetReferences] ([RatchetID], [Reference]) VALUES (1, 'Ratchet 1')
      INSERT INTO [dbo].[RatchetReferences] ([RatchetID], [Reference]) VALUES (2, 'Ratchet 2')
      SET IDENTITY_INSERT [dbo].[RatchetPrices] ON
      INSERT INTO [dbo].[RatchetPrices] ([RecordID], [RatchetID], [Price], [DateValidFrom], [DateValidTo], [Active]) VALUES (1, 1, 100, '2000-01-01 00:00:00.000', '2002-01-01 00:00:00.000', 'Y')
      INSERT INTO [dbo].[RatchetPrices] ([RecordID], [RatchetID], [Price], [DateValidFrom], [DateValidTo], [Active]) VALUES (2, 2, 50, '2000-01-01 00:00:00.000', '2002-01-01 00:00:00.000', 'Y')
      INSERT INTO [dbo].[RatchetPrices] ([RecordID], [RatchetID], [Price], [DateValidFrom], [DateValidTo], [Active]) VALUES (3, 3, 25, '2000-01-01 00:00:00.000', '2002-01-01 00:00:00.000', 'Y')
      SET IDENTITY_INSERT [dbo].[RatchetPrices] OFF
      INSERT INTO [dbo].[RatchetDescriptions] ([RatchetID], [ShortDescription], [Description], [Picture]) VALUES (1, N'A Ratchet', N'<description xmlns="http://www.red-gate.com/Ratchets/RatchetDescriptionSchema">
        <descriptiveText>A Ratchet</descriptiveText>
        <manufacturer>Acme Incorporated</manufacturer>
        <countryOfOrigin>United Kingdom</countryOfOrigin>
        <size length="12" width="4" height="7" />
      </description>', 0x474946383961db00d800e64300000000698495465863cccccc010f1b003366000b14333333666666999999ffffff032d51808080021e3600333334424aafafaf01162884a5bae0e0e07b9aae586e7c1116186699991a21252020201f1f1f4f4f4fb0b0b0dfdfdf4f636f7f7f7f6079883d4d57505050021a2f00003303294ac6d8e399cccc84a9c1b7cedc739bb61e517de9f0f494b5cad4e1ea336699e2ebf15a85a5517d9f7b878d365165144876b0c9d8333366afb3b613395a0916204d5d678fa3af2d4252bed3df7f8386d0dae3cddce68db1c7ffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000043002c00000000db00d8000007ff804382838485868788898a8b8c8d8e8f430907080390969798999a9b9c9d9e890900a20019081c9fa8a9aaabacad8708a21a1aa3a222090aaeb9babbbcabb000070a0a031f07b4c00913bdcbcccdce0a22a21bc2d40a1d091bc7a595cedddedf9a0ac60008d5e6c209bfb4a6b8e0eeeff0e2a2e5e7f5c308b3b4b6caf0fdfebb0346ddb2477098a463071870fbc7b0e1a680a206169c782d1bad52a71c6adca888c3280813439a83a06e14825b1c536e0c256a80c897e606e043984ca54d782c01b884c9b3dab571a3262dbc49b4d7af603d939ec3a6cd54d1a7ae8e2a9d5a8f643e5107a06afd248f1cd5aff5208ada4a36dc387a60d30a030aa0ac5b4813ffceaa552b76c482b66ff32a122b712ed59c0e0adcd54bd8105fbf60d515583c3891020efc0a13cdb913f1548b061633c67b48ec819a925352b64c751c09cd9b1189a5f53972e87f0cb05626cdb32eead4863cb62449d3f56b7052692785302af0ed020e380f1a4d8d376bd0bfbb0517ce33e782e3c8c915627ece7950e8d17775454bfda562ecc913149a5ed03b56f0e1578d2fcff35766ec1100a827c45ea47b64bec5d7c9001988f2017d308d13017605e4b79f200afc32cd54ffb526e08002212852070a32e82021f3a555217c173a729886138965dc711f0e12a25f2306582222dca1688f8a0c92a01321038cd3976531ce08ca28b3d9b8d4280c1660c0ff8e839c485f90420e72540746129453924b0ee5248a5096d85f95d55cc9609684d4586585198517215660dac3d27dd81970c05066b6a9807bf1bd6827356f26094c3b82b0a441917bf23956747a16da27837ff2c766a1f6e070682f1c5808508690a2230a9cc7352ae5a3999a03440e93eab2e677327eb2a5a29bfa198ca37f865acd003fd4709772aef4184b6faae8060048a142c4e96d5eb92897acd40494d9adbbe4444f979bd469670748a2a79db1f3209b2c00f731eb0a341f755712809a486be7380c26870088c76aabac66deb24220a8f640dbc897ac02b0226aeaf258a07eda0af32ebca5a6129b8130d98b08be851a4380b5eb3689a9bbdcde162fff2a71c542a87fe35a6a48a2a18a52c271e9f13831b203a376b127be4ef815b420870cc075a8b52888581b439ab2ca0573a2ce8f60c598b157010b234a0335eb57269145efcc33ae9ae80a4cce228e7b72c0bf186773244c07ecf4d39e38aba17b40070c948e0f72a00ed57b7e0df626e08a02ac8d107cc036b2161dc3dadd6dbafd7626f3024365d1eee6fd1ce17eff7d494e0712eef80090433e78d315274930d48e98ebf8e65e576ef9669837121b527c736e7adf9e7f2e58cf8e8cde020ff3cc7dfaec76268eddca8f8c2e841012547056e9b4073f97edb7b32e3a30bb274f81071800a00125c2474f1bf1c587ce88eec9674f410816389fc0e4d2873f15fff5d567827df6e85fc03d32e08bef7e8aa9abae3824e7a36f3f080f4853f6fbfc0f13bffc97cb044bec47c0ece14f1ab2eb9ffbc89724dc994814058ce0ee7a7796042a30780c6ca0f1180111097a907715681e398077c160fd0f80f37b44073ff8c1e535ef7925345d062de7c046ac90852cbc40f3f617c34ccd90861b5cc40d71e8c10a10ad879d1b160acb87892112b180f9e32112db76c2255a2c887b81e0132318c52926d18aaaab2107b5b845fb75d18b28ab221853f8400094117d12681e09d188a01f02508c4224e31be3a8133acaca8e77c462229cf8440a6060507e34a112d7c8203c66d18d6fbc40ac12a9333532f28ad6cb2324b72849a450b2ff50805ca22307a9471c0660929fac9d252f8949c095f28346244f2ac1144a2b8e5235af94602c6749c545b25283997c24113d0080c6f19296abfc652b9b984b029ef19855aae51a6fd99966a2ef99d0b49134a729485c02e002129480312c984dfa6c939bc15484280210413eceb19c6939273a35b1ce02ba139eda4ca6321bd94d44d4d37e3a9c133e51244f4652f310ffcc5e27076aa30f706b5ffb44e1410d91d0dd2d94a174fb0509201a5120a633111505c111316a24e79060641df5283d01c0cedded92a47b620a002280d2942e1313ff7c294c217510008cc0a66c74443d4300b09dcaea27a2f8a94d275a887562d3a87f9c8901387a49a612421433ff282a5411679f9a56b59f8669c956677710655a7508be6a1fa43a50b70f24e09dbc7401ef00803456e6e7a3dbe95ab00c370a63c254aebb130000ec3a0f4b080aaed4c989dee406d314644f0274656472aef50886d949b18b652c431d8b3ec1ae71b2afaa2cbd3285d9cc8a82a127202064a9fa39363d22663135ed62a548c9d44271b04b24d26bdb152a87ca566f7ee5250b5a20410ae80b854b62522386264b4859edb75ae55c2836405b9ec080b81ecc1f0093fba03146445bcffdad2739e7d008fc0e2c806de1713f77d7ee6a32ba990aef6f67078bc0484002cc73de07d42a92203c51bb96bb6bc41aa1b936f115ba62355d7d0b400001244f7dddfb0cff4f384b44e3b2363b94654481c1c41604279873c6d04c83ef973f7290d31c3678238049e65a026b4c5b1df63062ab1462113b58b5be731ef4ea61db325a183b2d668465cfe5e163cc589b0718d6888b2b8008f785053d56316e51a3db7b8db69245a6c59109fabf257ff00225a6ee70dfa8bdf52e26b943710c6f7d98652dcbf0845ec6618e01400132676fc5dc6d046c55d9e60f3b2e140bc24e9c8928010b3cc0ceca9b59832262c3710497a77df633e1009da44113d1887546b4100e4000013bc247da2aad8c151cd94adff88d86d6b4102ed0bd0c2fc218cdcd579fb7aca1055bced24414293811ad021d78aa11c6d8010c6425dfdfd21a41b6bef5a9dfff788003f09ac1006000248ce16013c437d27d04f1943f876b229eb2a5658cc1620810ed6903e0c62770c19e8a2ddb63d3a7c6f2eb36119bfd461988b8dc8fa076f64e606d1a63dbddd41980067cc920799b92a55b7c016ac82ded7c9fdb7ea7dcc0892d13e3516fee8706c721bd718802852f1cdf9f7e38fa4e190b04f0772e154730c0851390875931e32cfc360b51b082e330dcdccbde1dc90f8798d5b479e5b4a1341861cec28d4b500535b739c8812df2eced5c6f3b068bcfb30c74d2087de83927b3244170f44a2f9d11fa1eb978ab5b90a917b9ea964936d655bdbb0758208217b8f5d75fddf4e43d5db60898b895b09d6dc7a97ded6c376e0508286effb9373ce459bffb6f35b0df9788dae28ecbc6850148741cbadd7e1e373cce211e690917c4b791d67ba6e0cdcacab350f0d9cbbce61d9e78be8fb01eec962dd9f744fad2671dd1971702cd293f774584dde9ae7f4f35626fdad9a38ee080f72005022001f55660f7bc3f3cd35b1f7c934020e508363e32919ffc0282a0d5c0c874040fd08397f73e11bfb77bf5d70f5f6d11e734293578fe025d8225edba8007a82b0a6fce7aceb3dff5da572557d751f2664410a523cd877ffa177d9b2776ff876d016824034880b737574a452c87a680e6277d6057773af78091168136f277145840c4942e74a6814bc47f88e77f20586422882224588204840117d8291ea0ff82fb777e88907e1ff8821ee63245630c5e0554b8065934831fce4640f9b7810d087c40586451272bb507540c767ba76439c9a1830cd87f0e188545a601df93291cb26d56386eb7674440c485f1c68387e08342a078608860d4d54b676873b727002ec74f6ca83a2c387d2e38877d36851a5250f196866678457dc86d6e680870288782188663882013788768484059982425b049e8d3842bd88885f08891587d75985833658982767bc6653923b084f6e3893bc88174477da3587d84a816a17083a868630564010b482c21b088abd7825f588bd5278627971433b88bdd4654fc747f9df88b7e088a84208ac6f880a54815cbc88c15f86336e78aaf288d8c28ff8bbee78171788d40788b22610c49b88b7818419e751bf9018dd1e8845e0885e8f882c8982089e88e0b57816d67663a3278e3278ec30888c5988f2f286613010bfea86c1e2458a360015c2741b0d885c4888f0a1985ec740227e00326109229e09142a0870f696a1f2401015001e0669106e975e4887ee608891bc97e2d4940267992a9c876d973916d18933d389335098637693f39a993b7617a1af79205478d83608d43f98245d9597b8894bcc893bbe393d308946f28945129951159955679855899954c29684e290850f995ff478f46299656a9944577964ac7958ee8956cf97f1f749463499665a995e3f884ea97977a19967d79955809984932597619ff8a784998d5b79770899472f9418a692dbf86901a0999ae074bfda89395e941978949a1758f83c999c1f741997898a1e99200340aa9528eb4889a7ca79a9f7992ad5990f2536596b096b41969b6799897f89774c99bbdf998bfd967c1299cb9298c9a81669ae09bc99965cb79980b207e3c399a79169dc8399d45569d8759966689258cb609d2e99d08069e56991c0f5091d969903aa2349c709ee8f95beaa99393350aedc97680e9699d409ff599596fe741ab899477d56cc7f0006ef9445ae99fffd99d016a5ae05840057a92078a0b13c000ff220a1610020b6a99bf380285f509001aa108719fee78a18520131b0a001dfaa15c085aa950a2261a14288aff8a2aaa1a08d0a22f3a979a015a80e209345aa3c843a0b779860e2a443b4a0b18e001d8198e8b01a4aa30a4353aa19878a44095a48ea036c7d0a44f3a9e05200a1910a4240aa144ca1a376a855a6a095ccaa44eda9348639ca840a5266aa59ce78fe4e66a9ad0a6a3800115d07c34909f6936a7667aa65891a629955c03860a1c100dac7103723aa3e6284e869a59762a76bba8a8df92008e4a0bee35a5e6b83bdb53a9276aa4a8a8a9e2c1a9e5e90a70883e2144aa452a41156a53dbb90c0a109b840a900a5562677aa9c07787b52a19e320005faa5a1e007e11aaab1f7886c12a198af500538989bc5a9fca7a8e56d8aca131012561017f7a7a4d46ad88caff480251220a90002d1a02c54a4020807d7959adb3fa4be31a2503d0a9c010adf633aabfe9ae586a45f11a2582a0adb460011e9080b0c4ae1ba9af1dd5affeea223d250a0f90ae0035ad5f89b0fb14a90bdb24257100eee941bd83ac3549b1f0da1217bb08191ab0036b4a129b8f207b49163bb287d0b000a0a0382401dfaa902b0b469b28b22eab42194b902cb4ae2a1bae5ad8b23bab080aa0a113290004ab7c12598b378b42825ab4e5c216d07a6906cb7e3e1b41efaa3a512bb50f51127e5a61290b82f6aa7e6034591930a85e8b09e5daa2c43ab3af0a8465bbac4b24a56bcba8543bb74e37b6c1a7b75b8b829979b79f00b013d9ad2c845f1eeb7a7ebbffaf3f1a6482ab0a6d4b0be8ea6d578b608b0b40221ab88fbb0af3ca1a7aab3c358b6d97ab3a39bab9ba40b81c7ab27256b98b35ba01e6b8a66b2ae64a0b0f5b6144d566aeeb21b01bbbbc2013acb1b11c1bb7968ba877250264cabbcb50b213a9ba39c4b7c790bbf238a2c80b0e302bb3337bacb205bd9ab1a6d3eb0dbe1b1459ab9a7cabbd8ba6a7dd0b0e47bba116a0b41516bad6f4ab4929bde7fb0fd50ba3ea0a14316786a83abf0ef1bda210b6b6cb895abb6dfbcbbf1a11b9a3f0b6e2891a056cc01c5129b4fbb944f49cf2ebc02a81ba00e0a74b6b6767b6aa164c14082c0a938b684ae2c11ffc148deab9642601d87ac24f81c1dcbac11c2b429fea39c25a11c2310bb10a45c3365c189d1b14c0fb8535dcc36ea1bca94bb02a995f264cc48501b396aab64cecc3cf8511514cae910339c7ebc28100003b)
      INSERT INTO [dbo].[RatchetDescriptions] ([RatchetID], [ShortDescription], [Description], [Picture]) VALUES (2, N'A medium-sized Ratchet', N'<description xmlns="http://www.red-gate.com/Ratchets/RatchetDescriptionSchema">
        <descriptiveText>This is a medium-sized Ratchet, ideally suited for the home and garden environment</descriptiveText>
        <manufacturer>Magic Ratchet Company</manufacturer>
        <countryOfOrigin>USA</countryOfOrigin>
        <size length="15" width="12" height="2" />
      </description>', 0x474946383961d100ce00e64000000000ffffff465863cccccc698495333333999999666666032d51010f1bdfdfdf84a5ba4f4f4f1f1f1f7f7f7fafafaf003366111618586e7c0116287b9aae003333202020e0e0e0000b1434424a8080806699991a2125b0b0b03d4d575050504f636f607988021e36e2ebf1b7cedc84a9c194b5ca99cccc03294ae9f0f40000336b93b01e517dd4e1ea336699739bb65a85a5021a2fcddce6c6d8e3bed3df97aebc336666a2abb1617d8f11191f164a7849769a666699dbe6ed1a242c8db1c7ffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000040002c00000000d100ce000007ff804082838485868788898a8b8c8d8e8f90918701061f059797071a1d01929e9fa0a1a2a3a4a3010500a9aaab0007a5afb0b1b2b3a20316a90c0ebaba0ca8a91ab4c1c2c3c4a103aa0601cacbcba9058703c5d2d3d4b106aa03ccda07bf85a7a90717d5e3e4e589d7a9d9dacbdcdd83dfabe1e6f3f4d2ed050aebcbbe1309c082b6521968074e5cbd83084dddd3b72fd50408fe00225be660d5bf84183332827780618001be44408008ec98c07515535988a6b1a54b20015b793409a0c24892e800a8d347b0e3cb9f07692663f84095cd9b097ce9f4a86c4003672c814aad96f381c79c376faa2ab0936900821da68a2d46b0eb365559476270e6755d518163ffe3cafacad6633b0c69216c6dab0f2438b9804df962c0945f5e551df932f4e52ab0e3483113f77d0ae0615ac48a0bff7dcc7991d099460f83cbecd59781cea80d55bdaa0a85680043496bd699ba7659bb685fc796cd5465a7da8fe90228c0f46ede0aaaacf26e6bf203c20b9c803f8247d8a32f15c7b12d579c32aa390d88c34a574453f23aa70eb3a7db9ef9a985791794aab2206f7ca10e1319d23c9a15f970b3ec3165d269e4e087cb0006dcb25532f601911380cbe4e45a5a13d4156066a83c538d70b031330041a97c209e6da93400a1322901901704150e77a16c2679474c4c5c11c5002b07c808183cc4e106005e79b558dd8ba43dd5583139997795ff7c161860905cf18de6d18d0024b0e25a3211295b4ac5c0b354660a1c4099330c8a459303b3599616964a6ac9578cc31808c090bc7d88e3882fe5b4db3a86e585259a6ef206172d1ceeb99d0154aa549f46e0ad675d2afc65955fa0b2dd78642c7efd17a802068c395c990709878f8090ae3829a5a455a4a13598a1da14880088580f8f6da564ea49aeca864e2c017c905caeda3c9028383a4a13195fe8448a8076c0ae938f7ea9c042538fcdae6300934e52f399626326a002965f56bbcc31ca9d176d2904192aee32617afa01a8c1ac9659a6ab98b86e84738206002999da7baf80b0e6184c3bfec2e8c001b9947b2f378042bbaf2849fe9bd9b5abd0f724ff29b44a4ca402a8a8a36e006f8922a7c21ab7c5a9a705c0fb499459961ce031a3720cc0b3daa80a712af99ce8b27eb0cafac9993b07784d62309fc8cdaa3fa7620209b8901cb447c2e258ac227a3ebd1d37435d43279f005c9434003ffcb080048c396db5b5d85e9c48a3e19ead985fea30ec552a787a6252d8782f000207003490a3db1eb5bbcabbbf19222acd80b75554cca828778ca16fa92dc9dd78574e810011f46d00e2892ff340c0d910425de7dc6559b432d750cbccd1a3505ef9eb1b789079caa4a35def01392bd866edebdc9875cbdcec1e8091ada7f2faf1788790012e1f037ef22a4a35cffb471d2b8375431fc3598bf1c877ff4308654fff2aff2b3a4fbf783e32ab733a4337be573cd8de7b3f3663e59f2d2c03f5d75e11d1c33dab757183da1efce2173f0aecad6f7f135f0014d00ab391ce7728021e001aa60f5f38875fdc23a0062920bb4f71ae73146b80033ee836b8290382ca68dc6c2e25400dba106fb1838af80447bbc49d8f7a5f5a5f5f54e1b5f7bdf08762cb9c033bf739629d6d7fcab82125f2053564602a83408cdf02f8963f10a24284245c170a9168bd0932e541b2705d14bbb78108144c81ceba87f45065c200a050664314ce4a6621c631c2ce4568541c9512582d0554a78d3ad4079588438b3ada316c1260621e1513c2cdad4b89ff0b1c630a1746281ef2072068d922e7d50e06acf1ff425ca40b05cde58e6018728ccbfbe426a1b6c72a6ea9430b54216b02684a4b467101a850e52a99f2bc1aba497d9af2488aa6168b0ba46203879c62db76f9b24ec6913791f4510124178c5410c08e653c2333898428235ee87ab3f900258961cd316e008fdb4495021cf0145ff2a67afa6ac538ca09c4446e2d9d6c6cc7019ec9932ca2ce89f304c0357f9849e1e1135521c49d9686590e7aba30950795d83adba94b6952531a0e95622e23ea323bb5c295dab0e038ab91d1ee2913a41c75550847f836c4d4a3a4c7cb264a539a2b1aae514f078169e5cea93a9ada4f9f102a0b42748a4845fad48a9aa3d9202f4a0ea216f4a8e2f368477c41c884e814a250ff45e303ac023d9599a3a4b884655617e9d1f0bc54a0953be958b7d9cdf92c2aa003fd814cd78acfe72d68a4e444ab5cd149d783963544751b4639edd9d7a3462d1ec48485351369d0c21e9462f3c95635052a56c766557000ad64652d4bd7b2e25580cb74db0376e1809972561f27a040294b3132d2a5a85ea33cad62527082b02d0f009ff5c4833a472f56c850b6b33501de54dbb552ec367134f12df980db961608b7721e4805531fb110de2af7ba3d65ae365a80bc056c0614d545ee75c7cb4fced2c07b0290ee277a850bd22577bcac88ad764920c5ef428223ee85ef782b7a3606f0514bb525607a0130dd494c1284fa1def2a51910304fa93340126a0ff77e5f9886d252e27095e6e1e65068115707076fcd5460a9eebc20127961016061c8633cc2c341e032f088800de08705b06949719238ee2ec1a71dc0bb3d8b7a6ede88f46b2acd7cdcf9b5ee1ee1813491baab51870b0fa71904b760d3515197906cc5c031cc910195c72c7e728d194811565168f596255ceca95bd17c339198abe9764f2d4c29bb83267f8ccffba460cd2b2660282cf9b70bee40fc05c083a034e3e3f0e2defb81129220fd08563e39bdf048d37398beec09d43b49417c9e815f5f9871c048004281d36beb90f08f8259da6cdbc485420604510f834103320635213002ea946eeaaefdc6a15c13ad68f8ea26a474d6a54bc6740f94df42a42ffdc5154fcdad182a635a97f80837498a405d655f6a9a6f7e26743fb92aa1500a54bc0026b1b4f06807b8bb637cbbb6e7b1bd8944eef022ef98291981b7e2738db8a13cd6c2a57e6dddfbea477c56dc715684527622441d0f6fde37e6b2ccd008777bc0130ef28c2405208b7e5096ec0e575d939c30e975845441271890b7ae051dcc165321eecb00dd893e2fa788243feaf4e97dce48296f70f5d209a019c72c08879708064ae5f9a2fac26370ff8c9014070029680e73dffb972dd49a45d833c8fce4ebad2734e71a7b300d6f7461ed095fb5ff6587de658f7b5d6717ef20878207e2fd0c1afc37ebcb15f77cb429fcdba8d2e2ea70069ed6c17742229d0bdff7a3f9beeafb33b7c6d0ca3756fbb76ee067ce0051d810c20efe2de467ce5149f608532c7f1b88aea9025bf754a0ffe7598cf3ccbc5ee78aa6be3bdcae67bb5204efac953def27883fabb358f37ce27baec4b04bdec9b45fbdacbdaf40020fcd34bce7b9783be5eb16178c3d168f3da97bebb042040c509587972dfbcf93ff0bde3fdfbfce19319e9d6bfc9f1d37adb547860fbdd13800fbefefdd5d7fdf9f8f7adf97355fdf4db3e6ce7847ec8c101f05777569274e0277ef9177b689475fea77e2d97371cf0775a5100f1230007587f3e674be1b780f9275f99a6760f787dce0776c4267619c87cf697781ef87c8d753691378224f80300407241526b28a8ff7509d8828ef78256138332687b21208287814c3988802bb8793ca86dd945445512847c16813fe0012978184d97785508703bb884da067cfaf66f50a86652580036b82213608147a88152c785eb86452a0686610881dd837eb026026868803a9884bdc786cfe77a1ad37f71687b00f06abf6687f19785bba787cec787f8e78531478781488283f86c8698862ab88111a8808cf8636e782f373221912887c8c301659817958887488889acb7891ee88794e280a1288ac753006ab22209f0769618715bc88a2de8882f028bb14882e9757827888579a88af7c78b4bd889440284c1687be74488d95180bd8788aa878c2ca88c6ce88aa4e18ccfb87e3f5000d608ff00b8978b5aa8881da88d8ce88b5e710dd8f18c79018eb7d668101003c9875ed67878e8a889ea987fcc882c70088f627881902802a27681f93877fbd88fcac88d1e129002298bf1f723226090078990c7b8860ca98c3540033330022019923d300327706b11e9695268391970091e407802969060b7901ba98c46e83d26799251386dc6988a1a39939ba84137899312a9931898911cc88f3e997f40498438098e9754943c799449c98a4b299403a993d568949938953f49404169954e794850a98652c9957c58955639834f0993b7828d4a68966c889669199676349697d89370d98272099629b9964848607899970bb89742499763649789481b812998f847ff984dd99762c9963781252cb1988c097a8e799286194588f96b58422030910ad4889497c9629919919b09449d7925b4040430459aa59960a72990a9f943ab991609d09aaea9576f199bcfc701b3098fb5f942b779132dc24282f09abe897f7768934c89932b809559f96bc78908cab99ca0d79cddf39556199dd2197ef9688f147608d7899deba69dc8c39d27e91f191002d2799bfe813486509ee6a96ce8793cea2990feb10a1e5093398788f1995bbb19577b589f4c189ca1b89f07a020a9e076fe79985918a08b409f06ca62f7f93af9198cfb59990bba0a0e5a9759e81b8c40a1159a60175a39199aa0ce20391fc2a000e0762e499c55880d8d40a2250aff5f273a63cfa9a22e421e1daa0a1c0002318a9107d76423ca9b057aa31996a36193a27128a18dd001b012a4438a8a7a910e8f60a34a3a75081a84500a0952ca0a547a845812588aa0a55bca0a4cfa034e1a842d52559f10a6d02301f057949f1909689aa65bd1a50ff8a6020aa6be32a7f3c6032870a7788aa48ba8a7e37585dbb9a36eca16bc52096a6a032dd2438e005343a8a88bcaa7d6e7a7c14009811a0f9fa0537a93399aca0a8c9a9e8edaa7f6250ca0daaa9040544dda7ea79aaaf8b9aae9579dd570012736a1888a659853ab9c0a78ba2a17ce50a5def3677a6aab188aaba4a702b02a16d0e39e2e146a5bcaac28eaac80c7268f71016cf3a22040ff8ddd23017c53a2d8aaa350c8ada80159a990010fca66b48a9de7daa4da9a74ea5a1b7f5500c528451260aacb39af6c5aaf258725969a1adecaa0112000e29a9ef1ca9800dba6f6aa9be3c1aee4f8ae2615ac97f9b002fb6e86da2085f0571cb0aff1a3ac7929b2b7ea7f1debb186a3012e2a00c8da3dd66a9604daa8e997592a9b081d201f1930b3f143365cc9b3275b7b367bb38a70012012b2a0d6b0ea08b4cd2ab4124bb48940092eda922f14691bc9b4d94a7a430bb58ed001a13a1c588b9f4acb88614baf9247a35cbb32201201745ab520e0af9b58b6010b78689bb6a020b5fcf9b2dd43b27c28b7107b2b466ab7b5f0b50540add50a9bdae6b71b0bff6c582ab8afe0ad1e1aae3fe4b34ba8b837b7a18e3b0b149b017a8b65d1d582961b71989bb9850422fafa43569b7fa1fb6ea34bbac100b9aa90b00b8b3c1b30b63fb6bacfd6baae3b0c9b6bb126f5b68ee74210fba5bb5b0cf96ab2367976d725bcb84abcc52b0d01c0b2abe0b2a086b119c6bcb90ba9cf5b0e9b2bb795c3b7e385bdb0e6bcdb3b0e46bb0a480b6a9f1bbea7e9a9e53b2b0992b7f554aebe25be14a2bdef8b10390b3dde0b430deb42e71424f89bbf0971beb1dbb66eebaf2f3489c639c0048c1178ab0a54fb43340699782382c5fac02f3100846bb8d2991519acc13f61c00d2ab958d9c0e329c262b1b99d1b452311c22a6c26a68bbc40045511d11ac36201bb0daab0c974af38fc18bd7b4be58a9c3fec18c75bb5435cc4d211bd084bbdde430149acc4f6d1bdaf4301cab3b5520c1c24ec0c0540bfaa60a659bcc4f13b755e15c61e8b201a90c61dd0abf91b08003b)
      INSERT INTO [dbo].[RatchetDescriptions] ([RatchetID], [ShortDescription], [Description], [Picture]) VALUES (3, N'A small Ratchet', N'<description xmlns="http://www.red-gate.com/Ratchets/RatchetDescriptionSchema">
        <descriptiveText>This Ratchet has been discontinued. It was last sold in 2006.</descriptiveText>
        <manufacturer>Magic Ratchet Company</manufacturer>
        <countryOfOrigin>United Kingdom</countryOfOrigin>
        <size length="3" width="2" height="1" />
      </description>', 0x474946383961d100ce00e64000000000ffffff465863cccccc698495333333999999666666032d51010f1bdfdfdf84a5ba4f4f4f1f1f1f7f7f7fafafaf003366111618586e7c0116287b9aae003333202020e0e0e0000b1434424a8080806699991a2125b0b0b03d4d575050504f636f607988021e36e2ebf1b7cedc84a9c194b5ca99cccc03294ae9f0f40000336b93b01e517dd4e1ea336699739bb65a85a5021a2fcddce6c6d8e3bed3df97aebc336666a2abb1617d8f11191f164a7849769a666699dbe6ed1a242c8db1c7ffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000021f90401000040002c00000000d100ce000007ff804082838485868788898a8b8c8d8e8f90918701061f059797071a1d01929e9fa0a1a2a3a4a3010500a9aaab0007a5afb0b1b2b3a20316a90c0ebaba0ca8a91ab4c1c2c3c4a103aa0601cacbcba9058703c5d2d3d4b106aa03ccda07bf85a7a90717d5e3e4e589d7a9d9dacbdcdd83dfabe1e6f3f4d2ed050aebcbbe1309c082b6521968074e5cbd83084dddd3b72fd50408fe00225be660d5bf84183332827780618001be44408008ec98c07515535988a6b1a54b20015b793409a0c24892e800a8d347b0e3cb9f07692663f84095cd9b097ce9f4a86c4003672c814aad96f381c79c376faa2ab0936900821da68a2d46b0eb365559476270e6755d518163ffe3cafacad6633b0c69216c6dab0f2438b9804df962c0945f5e551df932f4e52ab0e3483113f77d0ae0615ac48a0bff7dcc7991d099460f83cbecd59781cea80d55bdaa0a85680043496bd699ba7659bb685fc796cd5465a7da8fe90228c0f46ede0aaaacf26e6bf203c20b9c803f8247d8a32f15c7b12d579c32aa390d88c34a574453f23aa70eb3a7db9ef9a985791794aab2206f7ca10e1319d23c9a15f970b3ec3165d269e4e087cb0006dcb25532f601911380cbe4e45a5a13d4156066a83c538d70b031330041a97c209e6da93400a1322901901704150e77a16c2679474c4c5c11c5002b07c808183cc4e106005e79b558dd8ba43dd5583139997795ff7c161860905cf18de6d18d0024b0e25a3211295b4ac5c0b354660a1c4099330c8a459303b3599616964a6ac9578cc31808c090bc7d88e3882fe5b4db3a86e585259a6ef206172d1ceeb99d0154aa549f46e0ad675d2afc65955fa0b2dd78642c7efd17a802068c395c990709878f8090ae3829a5a455a4a13598a1da14880088580f8f6da564ea49aeca864e2c017c905caeda3c9028383a4a13195fe8448a8076c0ae938f7ea9c042538fcdae6300934e52f399626326a002965f56bbcc31ca9d176d2904192aee32617afa01a8c1ac9659a6ab98b86e84738206002999da7baf80b0e6184c3bfec2e8c001b9947b2f378042bbaf2849fe9bd9b5abd0f724ff29b44a4ca402a8a8a36e006f8922a7c21ab7c5a9a705c0fb499459961ce031a3720cc0b3daa80a712af99ce8b27eb0cafac9993b07784d62309fc8cdaa3fa7620209b8901cb447c2e258ac227a3ebd1d37435d43279f005c9434003ffcb080048c396db5b5d85e9c48a3e19ead985fea30ec552a787a6252d8782f000207003490a3db1eb5bbcabbbf19222acd80b75554cca828778ca16fa92dc9dd78574e810011f46d00e2892ff340c0d910425de7dc6559b432d750cbccd1a3505ef9eb1b789079caa4a35def01392bd866edebdc9875cbdcec1e8091ada7f2faf1788790012e1f037ef22a4a35cffb471d2b8375431fc3598bf1c877ff4308654fff2aff2b3a4fbf783e32ab733a4337be573cd8de7b3f3663e59f2d2c03f5d75e11d1c33dab757183da1efce2173f0aecad6f7f135f0014d00ab391ce7728021e001aa60f5f38875fdc23a0062920bb4f71ae73146b80033ee836b8290382ca68dc6c2e25400dba106fb1838af80447bbc49d8f7a5f5a5f5f54e1b5f7bdf08762cb9c033bf739629d6d7fcab82125f2053564602a83408cdf02f8963f10a24284245c170a9168bd0932e541b2705d14bbb78108144c81ceba87f45065c200a050664314ce4a6621c631c2ce4568541c9512582d0554a78d3ad4079588438b3ada316c1260621e1513c2cdad4b89ff0b1c630a1746281ef2072068d922e7d50e06acf1ff425ca40b05cde58e6018728ccbfbe426a1b6c72a6ea9430b54216b02684a4b467101a850e52a99f2bc1aba497d9af2488aa6168b0ba46203879c62db76f9b24ec6913791f4510124178c5410c08e653c2333898428235ee87ab3f900258961cd316e008fdb4495021cf0145ff2a67afa6ac538ca09c4446e2d9d6c6cc7019ec9932ca2ce89f304c0357f9849e1e1135521c49d9686590e7aba30950795d83adba94b6952531a0e95622e23ea323bb5c295dab0e038ab91d1ee2913a41c75550847f836c4d4a3a4c7cb264a539a2b1aae514f078169e5cea93a9ada4f9f102a0b42748a4845fad48a9aa3d9202f4a0ea216f4a8e2f368477c41c884e814a250ff45e303ac023d9599a3a4b884655617e9d1f0bc54a0953be958b7d9cdf92c2aa003fd814cd78acfe72d68a4e444ab5cd149d783963544751b4639edd9d7a3462d1ec48485351369d0c21e9462f3c95635052a56c766557000ad64652d4bd7b2e25580cb74db0376e1809972561f27a040294b3132d2a5a85ea33cad62527082b02d0f009ff5c4833a472f56c850b6b33501de54dbb552ec367134f12df980db961608b7721e4805531fb110de2af7ba3d65ae365a80bc056c0614d545ee75c7cb4fced2c07b0290ee277a850bd22577bcac88ad764920c5ef428223ee85ef782b7a3606f0514bb525607a0130dd494c1284fa1def2a51910304fa93340126a0ff77e5f9886d252e27095e6e1e65068115707076fcd5460a9eebc20127961016061c8633cc2c341e032f088800de08705b06949719238ee2ec1a71dc0bb3d8b7a6ede88f46b2acd7cdcf9b5ee1ee1813491baab51870b0fa71904b760d3515197906cc5c031cc910195c72c7e728d194811565168f596255ceca95bd17c339198abe9764f2d4c29bb83267f8ccffba460cd2b2660282cf9b70bee40fc05c083a034e3e3f0e2defb81129220fd08563e39bdf048d37398beec09d43b49417c9e815f5f9871c048004281d36beb90f08f8259da6cdbc485420604510f834103320635213002ea946eeaaefdc6a15c13ad68f8ea26a474d6a54bc6740f94df42a42ffdc5154fcdad182a635a97f80837498a405d655f6a9a6f7e26743fb92aa1500a54bc0026b1b4f06807b8bb637cbbb6e7b1bd8944eef022ef98291981b7e2738db8a13cd6c2a57e6dddfbea477c56dc715684527622441d0f6fde37e6b2ccd008777bc0130ef28c2405208b7e5096ec0e575d939c30e975845441271890b7ae051dcc165321eecb00dd893e2fa788243feaf4e97dce48296f70f5d209a019c72c08879708064ae5f9a2fac26370ff8c9014070029680e73dffb972dd49a45d833c8fce4ebad2734e71a7b300d6f7461ed095fb5ff6587de658f7b5d6717ef20878207e2fd0c1afc37ebcb15f77cb429fcdba8d2e2ea70069ed6c17742229d0bdff7a3f9beeafb33b7c6d0ca3756fbb76ee067ce0051d810c20efe2de467ce5149f608532c7f1b88aea9025bf754a0ffe7598cf3ccbc5ee78aa6be3bdcae67bb5204efac953def27883fabb358f37ce27baec4b04bdec9b45fbdacbdaf40020fcd34bce7b9783be5eb16178c3d168f3da97bebb042040c509587972dfbcf93ff0bde3fdfbfce19319e9d6bfc9f1d37adb547860fbdd13800fbefefdd5d7fdf9f8f7adf97355fdf4db3e6ce7847ec8c101f05777569274e0277ef9177b689475fea77e2d97371cf0775a5100f1230007587f3e674be1b780f9275f99a6760f787dce0776c4267619c87cf697781ef87c8d753691378224f80300407241526b28a8ff7509d8828ef78256138332687b21208287814c3988802bb8793ca86dd945445512847c16813fe0012978184d97785508703bb884da067cfaf66f50a86652580036b82213608147a88152c785eb86452a0686610881dd837eb026026868803a9884bdc786cfe77a1ad37f71687b00f06abf6687f19785bba787cec787f8e78531478781488283f86c8698862ab88111a8808cf8636e782f373221912887c8c301659817958887488889acb7891ee88794e280a1288ac753006ab22209f0769618715bc88a2de8882f028bb14882e9757827888579a88af7c78b4bd889440284c1687be74488d95180bd8788aa878c2ca88c6ce88aa4e18ccfb87e3f5000d608ff00b8978b5aa8881da88d8ce88b5e710dd8f18c79018eb7d668101003c9875ed67878e8a889ea987fcc882c70088f627881902802a27681f93877fbd88fcac88d1e129002298bf1f723226090078990c7b8860ca98c3540033330022019923d300327706b11e9695268391970091e407802969060b7901ba98c46e83d26799251386dc6988a1a39939ba84137899312a9931898911cc88f3e997f40498438098e9754943c799449c98a4b299403a993d568949938953f49404169954e794850a98652c9957c58955639834f0993b7828d4a68966c889669199676349697d89370d98272099629b9964848607899970bb89742499763649789481b812998f847ff984dd99762c9963781252cb1988c097a8e799286194588f96b58422030910ad4889497c9629919919b09449d7925b4040430459aa59960a72990a9f943ab991609d09aaea9576f199bcfc701b3098fb5f942b779132dc24282f09abe897f7768934c89932b809559f96bc78908cab99ca0d79cddf39556199dd2197ef9688f147608d7899deba69dc8c39d27e91f191002d2799bfe813486509ee6a96ce8793cea2990feb10a1e5093398788f1995bbb19577b589f4c189ca1b89f07a020a9e076fe79985918a08b409f06ca62f7f93af9198cfb59990bba0a0e5a9759e81b8c40a1159a60175a39199aa0ce20391fc2a000e0762e499c55880d8d40a2250aff5f273a63cfa9a22e421e1daa0a1c0002318a9107d76423ca9b057aa31996a36193a27128a18dd001b012a4438a8a7a910e8f60a34a3a75081a84500a0952ca0a547a845812588aa0a55bca0a4cfa034e1a842d52559f10a6d02301f057949f1909689aa65bd1a50ff8a6020aa6be32a7f3c6032870a7788aa48ba8a7e37585dbb9a36eca16bc52096a6a032dd2438e005343a8a88bcaa7d6e7a7c14009811a0f9fa0537a93399aca0a8c9a9e8edaa7f6250ca0daaa9040544dda7ea79aaaf8b9aae9579dd570012736a1888a659853ab9c0a78ba2a17ce50a5def3677a6aab188aaba4a702b02a16d0e39e2e146a5bcaac28eaac80c7268f71016cf3a22040ff8ddd23017c53a2d8aaa350c8ada80159a990010fca66b48a9de7daa4da9a74ea5a1b7f5500c528451260aacb39af6c5aaf258725969a1adecaa0112000e29a9ef1ca9800dba6f6aa9be3c1aee4f8ae2615ac97f9b002fb6e86da2085f0571cb0aff1a3ac7929b2b7ea7f1debb186a3012e2a00c8da3dd66a9604daa8e997592a9b081d201f1930b3f143365cc9b3275b7b367bb38a70012012b2a0d6b0ea08b4cd2ab4124bb48940092eda922f14691bc9b4d94a7a430bb58ed001a13a1c588b9f4acb88614baf9247a35cbb32201201745ab520e0af9b58b6010b78689bb6a020b5fcf9b2dd43b27c28b7107b2b466ab7b5f0b50540add50a9bdae6b71b0bff6c582ab8afe0ad1e1aae3fe4b34ba8b837b7a18e3b0b149b017a8b65d1d582961b71989bb9850422fafa43569b7fa1fb6ea34bbac100b9aa90b00b8b3c1b30b63fb6bacfd6baae3b0c9b6bb126f5b68ee74210fba5bb5b0cf96ab2367976d725bcb84abcc52b0d01c0b2abe0b2a086b119c6bcb90ba9cf5b0e9b2bb795c3b7e385bdb0e6bcdb3b0e46bb0a480b6a9f1bbea7e9a9e53b2b0992b7f554aebe25be14a2bdef8b10390b3dde0b430deb42e71424f89bbf0971beb1dbb66eebaf2f3489c639c0048c1178ab0a54fb43340699782382c5fac02f3100846bb8d2991519acc13f61c00d2ab958d9c0e329c262b1b99d1b452311c22a6c26a68bbc40045511d11ac36201bb0daab0c974af38fc18bd7b4be58a9c3fec18c75bb5435cc4d211bd084bbdde430149acc4f6d1bdaf4301cab3b5520c1c24ec0c0540bfaa60a659bcc4f13b755e15c61e8b201a90c61dd0abf91b08003b)
      
      -- Populate Contacts
      SET IDENTITY_INSERT [dbo].[Contacts] ON
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (1, N'Christopher Martin', N'01446 175923', N'07634 717173', N'17 High Street', N'Darlington', N'Cheshire', '20070914 16:09:21.383', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (2, N'Joseph Bennett', N'01147 771824', N'07956 758471', N'37 Green Lane', N'Portsmouth', N'County Durham', '20070914 16:09:21.400', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (3, N'Joshua Scott', N'01940 919059', N'07331 757163', N'33 George Street', N'Llandudno', N'County Durham', '20070914 16:09:21.400', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (4, N'Daniel Powell', N'01659 216066', N'07272 134093', N'93 North Street', N'Newport', N'Cheshire', '20070914 16:09:21.417', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (5, N'Jennifer Washington', N'01502 976179', N'07225 483640', N'43 The Grove', N'Hull', N'Berkshire', '20070914 16:09:21.430', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (6, N'Anthony Lee', N'01200 660059', N'07696 849723', N'97 Stanley Road', N'Newport', N'Berkshire', '20070914 16:09:21.430', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (7, N'Rebecca Foster', N'01340 503829', N'07960 669272', N'79 Springfield Road', N'Salisbury', N'Licolnshire', '20070914 16:09:21.447', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (8, N'Ava Walker', N'01978 657197', N'07610 445571', N'29 North Street', N'Southall', N'Oxfordshire', '20070914 16:09:21.463', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (9, N'Matthew Ward', N'01324 940147', N'07903 833764', N'71 Kingsway', N'London EC', N'Staffordshire', '20070914 16:09:21.477', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (10, N'Matthew Mitchell', N'01661 433253', N'07822 453924', N'70 Cowley Street', N'Worcester', N'Rutland', '20070914 16:09:21.477', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (11, N'Megan Stewart', N'01653 610021', N'07363 920914', N'59 Broadway', N'Chelmsford', N'Berkshire', '20070914 16:09:21.493', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (12, N'Mia Robinson', N'01594 360107', N'07295 889232', N'22 The Avenue', N'Wigan', N'Norfolk', '20070914 16:09:21.510', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (13, N'Cameron Davis', N'01594 360107', N'07295 889232', N'35 Windsor Road', N'Watford', N'Rutland', '20070914 16:09:21.523', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (14, N'Emma Howard', N'01788 915553', N'07736 274237', N'43 Park Avenue', N'Wigan', N'Derbyshire', '20070914 16:09:21.540', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (15, N'Liam Taylor', N'01286 103534', N'07939 391131', N'47 York Road', N'Harrow', N'Shropshire', '20070914 16:09:21.540', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (16, N'Ross Ramirez', N'01945 464335', N'07126 593543', N'33 Kingsway', N'London WC', N'Herefordshire', '20070914 16:09:21.557', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (17, N'Sarah Lewis', N'01287 924924', N'07149 593067', N'91 George Street', N'Bristol', N'Cumberland', '20070914 16:09:21.570', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (18, N'Emma Taylor', N'01287 924924', N'07149 593067', N'92 Queen Street', N'Dundee', N'Kent', '20070914 16:09:21.587', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (19, N'Anthony Rivera', N'01788 915553', N'07736 274237', N'97 Church Road', N'Southampton', N'Huntingdonshire', '20070914 16:09:21.587', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (20, N'Ellie King', N'01945 464335', N'07126 593543', N'29 George Street', N'Lincoln', N'Lancashire', '20070914 16:09:21.603', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (21, N'Megan Barnes', N'01469 486350', N'07759 520189', N'92 West Street', N'York', N'Surrey', '20070914 16:09:21.620', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (22, N'Scott Watson', N'01630 243241', N'07886 967048', N'91 Mill Road', N'Chester', N'Norfolk', '20070914 16:09:21.633', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (23, N'Emily Anderson', N'01487 403649', N'07449 889487', N'100 George Street', N'Dorchester', N'Hertfordshire', '20070914 16:09:21.633', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (24, N'Nicole Martin', N'01721 599988', N'07525 825680', N'62 Kingsway', N'Colchester', N'Hertfordshire', '20070914 16:09:21.650', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (25, N'David Perry', N'01212 359994', N'07270 368607', N'59 Queen Street', N'London North', N'Cheshire', '20070914 16:09:21.667', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (26, N'Abbie Rogers', N'01120 243659', N'07237 275885', N'62 Manchester Road', N'Kirkcaldy', N'Cornwall', '20070914 16:09:21.680', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (27, N'Liam Kelly', N'01140 882420', N'07354 721715', N'88 St. John''s Road', N'Manchester', N'Northamptonshire', '20070914 16:09:21.680', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (28, N'Christopher Walker', N'01889 655242', N'07332 289915', N'73 North Street', N'Paisley', N'Yorkshire', '20070914 16:09:21.697', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (29, N'Matthew Collins', N'01305 665775', N'07352 869339', N'60 York Road', N'Outer Hebrides', N'Staffordshire', '20070914 16:09:21.713', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (30, N'Elidh Peterson', N'01183 454781', N'07295 215265', N'59 Albert Road', N'Norwich', N'Cheshire', '20070914 16:09:21.727', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (31, N'Jamie Price', N'01624 725814', N'07773 220491', N'40 Manor Road', N'Kingston upon Thames', N'Rutland', '20070914 16:09:21.743', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (32, N'Katie Sanchez', N'01192 635557', N'07695 694205', N'50 New Street', N'Hemel Hempstead', N'Cornwall', '20070914 16:09:21.743', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (33, N'Erin Rodriguez', N'01701 154719', N'07699 485122', N'8 York Road', N'Swindon', N'Derbyshire', '20070914 16:09:21.760', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (34, N'Abbie Brooks', N'01287 924924', N'07149 593067', N'73 Springfield Road', N'Ipswich', N'County Durham', '20070914 16:09:21.773', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (35, N'Lauren Simmons', N'01442 337633', N'07986 644216', N'98 London Road', N'London E', N'Cheshire', '20070914 16:09:21.790', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (36, N'Emily Bennett', N'01907 200803', N'07636 884168', N'90 West Street', N'Salisbury', N'Herefordshire', '20070914 16:09:21.790', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (37, N'Christopher Flores', N'01198 529461', N'07207 549127', N'74 Queens Road', N'Crewe', N'Cheshire', '20070914 16:09:21.807', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (38, N'Alexander Rivera', N'01120 243659', N'07237 275885', N'25 Grange Road', N'Dudley', N'Huntingdonshire', '20070914 16:09:21.820', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (39, N'Rachel Williams', N'01512 965727', N'07889 215998', N'62 Victoria Road', N'Dundee', N'Hampshire', '20070914 16:09:21.837', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (40, N'Olvia Howard', N'01547 693549', N'07341 808038', N'17 Kings Road', N'Guildford', N'Warwickshire', '20070914 16:09:21.837', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (41, N'Elizabeth Flores', N'01231 471798', N'07493 384582', N'64 The Green', N'Bournemouth', N'Staffordshire', '20070914 16:09:21.853', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (42, N'Kyle Griffin', N'01558 179557', N'07522 904690', N'21 Manchester Road', N'Kirkcaldy', N'Hampshire', '20070914 16:09:21.870', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (43, N'Laura Evan', N'01495 153619', N'07390 958114', N'68 Cowley Road', N'St Albans', N'Berkshire', '20070914 16:09:21.883', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (44, N'Katie Martinez', N'01285 948244', N'07424 397578', N'98 Windsor Road', N'Maidstone', N'Kent', '20070914 16:09:21.883', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (45, N'Sophie Griffin', N'01965 513379', N'07605 294144', N'10 The Green', N'Sheffield', N'Surrey', '20070914 16:09:21.900', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (46, N'Elidh Wood', N'01198 529461', N'07207 549127', N'88 North Road', N'Northampton', N'Essex', '20070914 16:09:21.917', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (47, N'Abigail Hill', N'01555 443077', N'07439 738948', N'86 The Drive', N'Sunderland', N'Hampshire', '20070914 16:09:21.930', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (48, N'Scott Bell', N'01469 486350', N'07759 520189', N'25 Park Avenue', N'Harrogate', N'Surrey', '20070914 16:09:21.930', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (49, N'Chloe Martin', N'01329 343662', N'07783 161081', N'33 New Street', N'Telford', N'Dorset', '20070914 16:09:21.947', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (50, N'Lauren Bryant', N'01752 908316', N'07676 584363', N'70 School Lane', N'Swindon', N'Middlesex', '20070914 16:09:21.963', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (51, N'Lucy Rivera', N'01287 924924', N'07149 593067', N'31 The Grove', N'Rochester', N'Cumberland', '20070914 16:09:21.977', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (52, N'Chloe Davis', N'01346 526218', N'07291 685237', N'99 The Crescent', N'Coventry', N'Shropshire', '20070914 16:09:21.977', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (53, N'Joseph Thompson', N'01237 661433', N'07302 871821', N'75 Grove road', N'Truro', N'Northumberland', '20070914 16:09:21.993', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (54, N'William Wright', N'01417 502667', N'07177 363555', N'57 Station Road', N'Romford', N'Middlesex', '20070914 16:09:22.010', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (55, N'William Hughes', N'01407 629329', N'07309 884547', N'34 High Street', N'Torquay', N'Dorset', '20070914 16:09:22.023', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (56, N'Samantha Miller', N'01333 824728', N'07634 606994', N'60 Park Lane', N'Cardiff', N'Surrey', '20070914 16:09:22.040', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (57, N'William Ramirez', N'01626 530682', N'07768 951632', N'95 Grange Road', N'Cardiff', N'Berkshire', '20070914 16:09:22.040', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (58, N'Lauren Green', N'01811 269842', N'07316 264705', N'28 Main Street', N'Huddersfield', N'Somerset', '20070914 16:09:22.057', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (59, N'Jordan Henderson', N'01624 725814', N'07773 220491', N'67 The Drive', N'Tonbridge', N'Surrey', '20070914 16:09:22.070', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (60, N'Michael Richardson', N'01346 526218', N'07291 685237', N'76 Highfield Road', N'Kilmarnock', N'County Durham', '20070914 16:09:22.087', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (61, N'Caitlin Washington', N'01291 914147', N'07913 286110', N'55 School Lane', N'Peterborough', N'Licolnshire', '20070914 16:09:22.103', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (62, N'Anna Long', N'01131 669331', N'07113 804523', N'41 The Avenue', N'Stevenage', N'Cornwall', '20070914 16:09:22.103', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (63, N'Ethan Parker', N'01940 919059', N'07331 757163', N'76 York Road', N'Blackpool', N'Middlesex', '20070914 16:09:22.120', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (64, N'Lauren Ramirez', N'01417 502667', N'07177 363555', N'74 Albert Road', N'Crewe', N'Kent', '20070914 16:09:22.133', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (65, N'Joshua Price', N'01404 421474', N'07720 314778', N'24 The Green', N'Southend on Sea', N'Yorkshire', '20070914 16:09:22.150', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (66, N'Kyle Botton', N'01291 914147', N'07913 286110', N'25 Kingsway', N'Aberdeen', N'Lancashire', '20070914 16:09:22.150', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (67, N'Bethany Hughes', N'01210 611735', N'07709 761071', N'6 New Street', N'Stevenage', N'Buckinghamshire', '20070914 16:09:22.167', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (68, N'Kyle Smith', N'01555 443077', N'07439 738948', N'90 Main Street', N'Cardiff', N'Buckinghamshire', '20070914 16:09:22.180', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (69, N'Caitlin Griffin', N'01469 486350', N'07759 520189', N'100 Mill Road', N'Oxford', N'Sussex', '20070914 16:09:22.197', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (70, N'Jamie Perez', N'01572 459202', N'07858 711874', N'86 Queens Road', N'Nottingham', N'Staffordshire', '20070914 16:09:22.213', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (71, N'Jennifer Turner', N'01192 635557', N'07695 694205', N'46 London Road', N'Brighton', N'Kent', '20070914 16:09:22.213', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (72, N'Alexander Barnes', N'01281 554917', N'07800 642581', N'78 North Street', N'London W', N'Lancashire', '20070914 16:09:22.227', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (73, N'Megan Campbell', N'01205 396727', N'07198 312473', N'20 Park Avenue', N'Blackburn', N'Suffolk', '20070914 16:09:22.243', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (74, N'Lewis Collins', N'01237 661433', N'07302 871821', N'10 Victoria Road', N'Southall', N'Norfolk', '20070914 16:09:22.260', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (75, N'Bethany Peterson', N'01784 976829', N'07885 861269', N'43 The Crescent', N'Worcester', N'Surrey', '20070914 16:09:22.260', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (76, N'Erin Martin', N'01428 428418', N'07377 251946', N'39 The Avenue', N'Milton Keynes', N'Suffolk', '20070914 16:09:22.273', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (77, N'Joseph Coleman', N'01788 915553', N'07736 274237', N'95 Park Avenue', N'Wolverhampton', N'Leicestershire', '20070914 16:09:22.290', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (78, N'Jordan Scott', N'01500 424473', N'07824 778422', N'12 Stanley Road', N'Galashiels', N'Cambridgeshire', '20070914 16:09:22.307', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (79, N'Kieran Kelly', N'01633 392324', N'07960 870808', N'91 London Road', N'Twickenham', N'Northumberland', '20070914 16:09:22.320', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (80, N'Tony Brown', N'01231 471798', N'07493 384582', N'41 Queensway', N'Falkirk', N'Berkshire', '20070914 16:09:22.337', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (82, N'Bethany Rivera', N'01784 976829', N'07885 861269', N'54 Church Street', N'London E', N'Northumberland', '20070914 16:09:22.353', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (83, N'Laura Hayes', N'01982 956405', N'07109 544766', N'56 Station Road', N'Brighton', N'Devon', '20070914 16:09:22.370', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (84, N'Anna Griffin', N'01345 471798', N'07493 384582', N'40 Windsor Road', N'Guildford', N'Cornwall', '20070914 16:09:22.383', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (85, N'Samantha Jackson', N'01231 471798', N'07493 384582', N'14 New Street', N'Llandudno', N'County Durham', '20070914 16:09:22.400', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (86, N'Kyle Sanchez', N'01978 657197', N'07610 445571', N'3 Windsor Road', N'Bromley', N'Oxfordshire', '20070914 16:09:22.400', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (88, N'Joseph Gray', N'01211 864653', N'07375 760438', N'56 South Street', N'London E', N'Gloucestershire', '20070914 16:09:22.430', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (89, N'Courtney Perry', N'01210 611735', N'07709 761071', N'13 St. John''s Road', N'York', N'Berkshire', '20070914 16:09:22.447', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (90, N'Matthew Campbell', N'01743 360803', N'07394 612512', N'68 Queen Street', N'Romford', N'Essex', '20070914 16:09:22.463', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (91, N'Alexis Cook', N'01624 725814', N'07773 220491', N'36 Queen Street', N'Falkirk', N'Norfolk', '20070914 16:09:22.463', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (92, N'Jamie Mitchell', N'01776 202627', N'07185 505540', N'90 High Street', N'Kingston upon Thames', N'Warwickshire', '20070914 16:09:22.477', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (93, N'Chloe Morris', N'01725 222331', N'07526 574605', N'97 Main Street', N'Bradford', N'Cambridgeshire', '20070914 16:09:22.493', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (94, N'Lauren Morris', N'01914 784723', N'07798 945002', N'44 Church Street', N'Durham', N'Warwickshire', '20070914 16:09:22.510', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (95, N'Olvia Barnes', N'01811 269842', N'07316 264705', N'78 Stanley Road', N'Lincoln', N'Herefordshire', '20070914 16:09:22.510', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (96, N'Olvia Hall', N'01571 657822', N'07694 711784', N'14 Windsor Road', N'Coventry', N'Middlesex', '20070914 16:09:22.523', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (97, N'Scott Turner', N'01555 443077', N'07439 738948', N'87 Station Road', N'Salisbury', N'Surrey', '20070914 16:09:22.540', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (98, N'Rebecca Hayes', N'01802 342584', N'07296 315860', N'94 George Street', N'Bournemouth', N'Somerset', '20070914 16:09:22.557', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (99, N'Kyle Perry', N'01653 610021', N'07363 920914', N'82 The Grove', N'Derby', N'Gloucestershire', '20070914 16:09:22.570', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (100, N'Kieran Patterson', N'01389 465402', N'07266 836025', N'3 St. John''s Road', N'Bolton', N'County Durham', '20070914 16:09:22.570', N'Matt.Mitchell@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (101, N'Tony Botton', N'01467 283712', N'07123 873472', N'56 Albert Square', N'Greater London', N'London', '20070919 09:16:00.000', N'Tony.Botton@example.com')
      INSERT INTO [dbo].[Contacts] ([ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email]) VALUES (102, N'Robert Brown', N'01325 348273', N'07263 764373', N'652 Long Road', N'Northampton', N'Kent', '20070919 09:17:00.000', N'Robert.Brown@example.com')SET IDENTITY_INSERT [dbo].[Contacts] OFF
      
      -- Populate RatchetPurchases with lots of data
      DECLARE @purchaseCount int
      SET @purchaseCount = 0
      SET NOCOUNT ON
      DECLARE @temp float
      SET @temp = RAND(1)
      WHILE (@purchaseCount < 100) BEGIN
      	INSERT INTO [dbo].[RatchetPurchases] ([RatchetPriceID], [Quantity], [InvoiceNumber], [Date]) VALUES (
      		CONVERT (int, RAND() * 3) + 1, -- RatchetPriceID
      		CONVERT (int, RAND() * 100) + 1, -- Quantity 
      		'WIDG' + convert (nvarchar(10), convert (int, RAND() * 10000) + 1), -- InvoiceNumber
      		CONVERT (datetime, -- Date
      			CONVERT (nvarchar (50), 
      				'2007-' + 
      				CONVERT (nvarchar (2), CONVERT (int, RAND() * 11) + 1) + '-' + 
      				CONVERT (nvarchar (2), CONVERT (int, RAND () * 27) + 1)
      			)
      		)
      	)
      	SET @purchaseCount = @purchaseCount + 1
      END
      SET NOCOUNT OFF
      
      COMMIT TRANSACTION
      GO
    • SMS_SelectData.sql - click expand source below for the script to copy

       --View data
      
      SELECT [RatchetPriceID], [Quantity], [InvoiceNumber], [Date] FROM [dbo].[RatchetPurchases]
      GO
      SELECT [ID], [Name], [PhoneWork], [PhoneMobile], [Address1], [Address2], [Address3], [JoiningDate], [Email] FROM [dbo].[Contacts]

The scripts are displayed in the Scripts to Execute pane:

2. Create databases

The worked example uses the following databases:

  • RatchetDev
  • RatchetTest
  • RatchetLive

We are going to create these by executing the SMS_CreateDatabases.sql script that you have already added to SQL Multi Script.

  1. Specify the database that SQL Multi Script will execute the database creation script against. In the Database Distribution List pane, click Configure to open the Configure Database Distribution Lists dialog.
  2. For this example, you will execute the script against the default database on a SQL Server. Select the SQL Server instance on which you want to create the databases, then click Add. SQL Multi Script adds the default database for the SQL Server (e.g. master) to the Databases to Execute Against list.

  3. Click OK. The database you added is now shown in the Database Distribution List pane on the main screen.
  4. Before you execute scripts, you need to choose how SQL Multi Script will behave if there is an error executing any part of one of the scripts. You do this in the On error list above the Database Distribution List pane.

    For this example, select Stop executing on database with error.

    For information on these options, see Configuring error handling.

  5. In the Scripts to Execute list, right-click SMS_CreateDatabases.sql then select Execute This Script Only. Note that this option executes only the script you have currently selected, so there is no need to exclude the other scripts manually before you do this.

    SQL Multi Script executes the SMS_CreateDatabases.sql script and displays the Results pane.

In this example, the script does not contain statements that return results, so the Results pane only includes a Messages tab that reports that the script has been executed successfully. In the next step, we will see an example that returns results.

3. Create the schema and populate databases

Now that we have created the three Ratchet databases, we need to run scripts to create the database schema and populate the databases. To do this, we are going to set up a distribution list that includes these databases, then execute scripts against all the databases at once.

  1. In the Database Distribution List pane, click Configure to display the Configure Database Distribution Lists dialog:

  2. The default distribution list displayed. You are going to create a new distribution list just for the Ratchet databases. Click New to display the Create New Database Distribution List dialog. Type Ratchet in the Name box, then click Create.
    The new Ratchet distribution list is displayed.
  3. To add databases to this distribution list, find the SQL Server on which you created the Ratchet Databases, then click to see all the databases in this SQL Server. Select the RatchetDev, RatchetTest, and RatchetLive databases, then click Add.

  4. Click OK to save your new database distribution list. The Database Distribution List pane displays your new list:

  5. Select and order the scripts to execute. In the Scripts to Execute list, the check boxes next to the scripts you created are currently selected so every script will be executed. You have already executed SMS_CreateDatabases.sql, so clear the check box next to it to exclude it.
    Notice that the numbers next to the scripts change, to indicate the order in which the remaining three scripts will be executed. You need to execute the scripts in the following order:
    • SMS_CreateSchema.sql
    • SMS_InsertData.sql
    • SMS_SelectData.sql

      If your scripts are not listed in this order, re-order them using and .

      Your script list should now look like this:

  6. Click Execute Now. SQL Multi Script executes the scripts and displays a Results pane at the bottom of the window.

4. Check results

You've now created and populated the tables for the three Ratchet databases. The scripts executed also queried the databases to ensure that deployment was successful.

In the Scripts Executed list, click on SMS_SelectData.sql. The results for this script are displayed.

Notice that there are two Results tabs for this script: one for each Select statement that the script contained. For more information about the Results pane display and how to save your results, see Working with results.

You've now completed the worked example. This has provided a basic overview of how you might use SQL Multi Script, but there are features that we have not covered here. Explore these features by experimenting further with the Ratchet databases, and by clicking on to view hints on using SQL Multi Script.


Do you have any feedback on this documentation?

Let us know at sqlmonitorfeedback@red-gate.com


Didn't find what you were looking for?