DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Which Tool Is Better for Code Completion — Azure Data Studio or dbForge SQL Complete?
  • Microsoft Azure Backup Service
  • Amazon RDS vs Azure SQL — Know the Key Differentiators and Choose the Best
  • Azure Databricks: 14 Best Practices For a Developer

Trending

  • Information Security: AI Security Within the IoT Industry
  • Distributed Tracing Best Practices
  • Analyzing Stock Tick Data in SingleStoreDB Using LangChain and OpenAI's Whisper
  • Best Practices for Developing Cloud Applications
  1. DZone
  2. Data Engineering
  3. Databases
  4. Lack of Trace Flags in Azure SQL Database

Lack of Trace Flags in Azure SQL Database

One of the ways that you can take more direct control over your SQL Server instances is through the use of trace flags. However, working within Azure SQL Database, trace flags are not a part of your tool set.

Grant Fritchey user avatar by
Grant Fritchey
·
Dec. 20, 15 · Tutorial
Like (3)
Save
Tweet
Share
3.16K Views

Join the DZone community and get the full member experience.

Join For Free

One of the ways that you can take more direct control over your SQL Server instances is through the use of trace flags. There are a number that many people recommend you enable by default. Prior to Extended Events, for example, I’d say you should turn on trace flag 1222 in order to capture deadlock information on your server (now I just recommend you use the system_health session). I absolutely think you should turn on trace flag 2371 to get better behavior out of your automated statistics updates. I’ll leave the systems experts to advise you on the others.

What about Azure SQL Database?

I doubt you’ll be shocked, but if I try this:

1 DBCC TRACEON (2371,-1);

I get the following error:

Image title

This error makes sense right? We’re talking about a Platform as a Service (PaaS). You’re only managing the database, not the server, so you don’t have access to control underlying server behavior.

How about if we just want to modify the behavior of a query? You can use the query hint QUERYTRACEON to adjust behavior. For example, the new statistics cardinality estimation engine in 2014 and better is absolutely marvelous. It’s in use in Azure SQL Database. However, there are edge cases where the old way can work better for certain queries. If you want to go to the old cardinality estimation engine in SQL Server 2014/2016, you use traceflag 9481 in a query hint like this:

1 2 3 4 5 6 7 SELECT  *FROM    Sales.SalesOrderHeader ASsohJOIN    Sales.SalesOrderDetail ASsod        ONsod.SalesOrderID = soh.SalesOrderIDWHERE   sod.OrderQty > 30ANDsod.ProductID = 867OPTION(QUERYTRACEON 9481);

Bad news. The error message is the same.

Working within Azure SQL Database, trace flags are not a part of your tool set.

Database sql azure

Published at DZone with permission of Grant Fritchey, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Which Tool Is Better for Code Completion — Azure Data Studio or dbForge SQL Complete?
  • Microsoft Azure Backup Service
  • Amazon RDS vs Azure SQL — Know the Key Differentiators and Choose the Best
  • Azure Databricks: 14 Best Practices For a Developer

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: