Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ETL with Azure Cookbook

You're reading from  ETL with Azure Cookbook

Product type Book
Published in Sep 2020
Publisher Packt
ISBN-13 9781800203310
Pages 446 pages
Edition 1st Edition
Languages
Concepts
Authors (3):
Christian Cote Christian Cote
Profile icon Christian Cote
Matija Lah Matija Lah
Profile icon Matija Lah
Madina Saitakhmetova Madina Saitakhmetova
Profile icon Madina Saitakhmetova
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 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 €14.99/month. Cancel anytime