
The Red Gate Guide SQL Server Team-based Development Phil Factor, Grant Fritchey, Alex Kuznetsov, and Mladen Prajdi ´c ISBN: 978-1-906434-48-9 The Red Gate Guide to SQL Server Team-based Development By Phil Factor, Grant Fritchey, Alex Kuznetsov, and Mladen Prajdić First published by Simple Talk Publishing 2010 Copyright Phil Factor, Grant Fritchey, Alex Kuznetsov, and Mladen Prajdić 2010 ISBN 978-1-906434-48-9 The right of Phil Factor, Grant Fritchey, Alex Kuznetsov and Mladen Prajdić to be identified as the authors of this work has been asserted by them in accordance with the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this publication may be reproduced, stored or introduced into a retrieval system, or transmitted, in any form, or by any means (electronic, mechanical, photocopying, recording or otherwise) without the prior written consent of the publisher. Any person who does any unauthorized act in relation to this publication may be liable to criminal prosecution and civil claims for damages. This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, re-sold, hired out, or otherwise circulated without the publisher's prior consent in any form other than that in which it is published and without a similar condition including this condition being imposed on the subsequent publisher. Editor: Tony Davis Technical Reviewer: Peter Larsson Additional Material: Roger Hart and Allen White Cover Image:Paul Vlaar Copy Edit: Gower Associates Typeset & Designed: Matthew Tye & Gower Associates Table of Contents Introduction .................................................................................. xiii Chapter 1: Writing Readable SQL ................................................. 16 Why Adopt a Standard? .........................................................................................................16 Object Naming Conventions ................................................................................................18 Tibbling...............................................................................................................................18 Pluralizing...........................................................................................................................19 Abbreviating.(or.abrvtng).................................................................................................19 [Escaping]........................................................................................................................... 20 Restricting...........................................................................................................................22 A.guide.to.sensible.object.names....................................................................................23 Code Layout ............................................................................................................................26 Line-breaks........................................................................................................................ 26 Indenting............................................................................................................................27 Formatting.lists..................................................................................................................27 Punctuation....................................................................................................................... 28 Capitalization.................................................................................................................... 29 Getting.off.the.fence…..................................................................................................... 30 Summary ..................................................................................................................................34 Chapter 2: Documenting your Database .....................................36 Why Bother to Document Databases? ................................................................................36 Where the Documentation Should Be Held ......................................................................37 What Should Be In the Documentation? ...........................................................................39 How Should the Documentation Be Published? ...............................................................39 What Standards Exist? .......................................................................................................... 40 XMLDOCS........................................................................................................................40 YAML.and.JSON............................................................................................................... 44 How Headers are Stored in the Database .......................................................................... 46 Extended.properties......................................................................................................... 47 Get Information Out of Headers ......................................................................................... 51 Publishing the Documentation ............................................................................................ 55 Summary ..................................................................................................................................58 Chapter 3: Change Management and Source Control ................59 The Challenges of Team-based Development .................................................................. 60 Environments..........................................................................................................................61 Development.environments............................................................................................63 Testing,.staging.and.production.environments...........................................................65 Source Control ....................................................................................................................... 69 Source.control.features................................................................................................... 70 Source.control.systems.....................................................................................................72 Database.objects.in.source.control.................................................................................75 Getting.your.database.objects.into.source.control......................................................77 Managing.data.in.source.control................................................................................... 87 Summary ..................................................................................................................................93 Chapter 4: Managing Deployments ..............................................94 Deployment Schemes ........................................................................................................... 94 Visual.Studio.2010.Premium.tools................................................................................96 Red.Gate.SQL.Source.Control......................................................................................105 Automating Builds for Continuous Integration .............................................................. 114 What.is.continuous.integration?...................................................................................115 Example:.deploying.to.test............................................................................................ 116 Creating.test.data............................................................................................................ 118 Automation.with.MSBuild,.NAnt,.and.PowerShell................................................... 118 Automation.with.CruiseControl.................................................................................. 123 Summary ................................................................................................................................ 125 Chapter 5: Testing Databases ..................................................... 126 Why Test a Database? .......................................................................................................... 127 Essential Types of Database Testing ................................................................................. 127 Black-box.and.white-box.testing..................................................................................128 Unit.testing.......................................................................................................................130 Integration.and.acceptance.testing...............................................................................131 Stress.testing.databases.................................................................................................. 132 Error.testing......................................................................................................................133 Essentials for Successful Database Testing .......................................................................133 The.right.attitude.............................................................................................................133 A.test.lab........................................................................................................................... 135 Source.control..................................................................................................................136
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages360 Page
-
File Size-