Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ETL with Azure Cookbook

You're reading from   ETL with Azure Cookbook Practical recipes for building modern ETL solutions to load and transform data from any source

Arrow left icon
Product type Paperback
Published in Sep 2020
Publisher Packt
ISBN-13 9781800203310
Length 446 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Christian Cote Christian Cote
Author Profile Icon Christian Cote
Christian Cote
Matija Lah Matija Lah
Author Profile Icon Matija Lah
Matija Lah
Madina Saitakhmetova Madina Saitakhmetova
Author Profile Icon Madina Saitakhmetova
Madina Saitakhmetova
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Chapter 1: Getting Started with Azure and SSIS 2019 2. Chapter 2: Introducing ETL FREE CHAPTER 3. Chapter 3: Creating and Using SQL Server 2019 Big Data Clusters 4. Chapter 4: Azure Data Integration 5. Chapter 5: Extending SSIS with Custom Tasks and Transformations 6. Chapter 6: Azure Data Factory 7. Chapter 7: Azure Databricks 8. Chapter 8: SSIS Migration Strategies 9. Chapter 9: Profiling data in Azure 10. Chapter 10: Manage SSIS and Azure Data Factory with Biml 11. Other Books You May Enjoy

Generating T-SQL to drop and create all indexes

In this second recipe, we will demonstrate another Biml metadata-based superpower. Sometimes you will need to drop all your table indexes and then recreate them. Instead of doing it through dynamic SQL, you can do it faster with Biml, because it gives you complete SQL statements. Let's generate SQL statements to drop and create indexes for each table.

Getting ready

Open Visual Studio 2019, and then open the ETLInAzure SSIS project.

Just think of a name for your second BimlScript file. Let's be original and call it Recipe2.Biml.

How to do it…

Let's add a new BimlScript file for this recipe.

  1. Add a new BimlScript file to your solution. Rename it to Recipe2.biml. It should contain only opening and closing Biml tags.
  2. Add the following code between Biml tags to configure a database connection and get the metadata of the database using the GetDatabaseSchema() method:
    <# var sourceConnection...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime