Questions tagged [azure-sql-database]

Azure SQL Database is a relational database-as-a-service from Microsoft. This tag is for questions about Azure SQL Database, NOT SQL Server hosted in an Azure VM (use azure-vm).

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Calendar Event table - best practice setup for range queries and individual retrieval

This seems like a generic problem that should have been solved already, but I can't find anything about this. In general this question is - given a table where data is read by a date range, what is ...
0
votes
0answers
16 views

Prepared statement with parameters repeated multiple times throughout the query [closed]

I have a complex query issued via JDBC consisting of 2 string parameters and multiple SELECT statements, some of which nested. The same DB TABLE is queried multiple times and each query parameter is ...
2
votes
1answer
44 views

Dynamic Data Masking Doesn't Seem To Work Correctly With ISNULL

Here is the code to reproduce the issue: CREATE TABLE [dbo].[EmployeeDataMasking]( [RowId] [int] IDENTITY(1,1) NOT NULL, [EmployeeId] [int] NULL, [LastName] [varchar](50) MASKED WITH (...
1
vote
0answers
19 views

Choose Right Azure SQL [closed]

I'm new to Azure and now trying to migrate the On-premises SQL databases on azure. I have chosen VM SQL for migration because I just want to lift and shift architecture and need to restore backup file ...
0
votes
1answer
47 views

Need help to optimize this slow performance Query

Need help to refactor a query. I need to get a result from four tables and structure looks like this Resource table Id | Leader | Title | Author | ResourceField Table Id | ResourceId | Position | ...
0
votes
0answers
32 views

azure index recommendation

I have 142 SQL databases on Azure. There are using Standard Elastic Pool (100 eDTUs). Azure Portal recommended an index for one my database. It says disk space needed is 1045.19 MB. Azure portal ...
0
votes
0answers
12 views

What is the current recommended way of changing the collation of an Azure SQL database?

We would like to switch to using the Latin1_General_100_CI_AI_SC_UTF8 collation in our Azure SQL database. Altering the collation of individual columns aside, if this were on-premise SQL Server 2019, ...
0
votes
1answer
29 views

Azure SQL database DTU compute utilization maxing out

I have an Azure SQL database that has gone from a low DUT baseline between 0-3% (avg) to now maxing out at 100% utilization. This is for a LOB application and we need to understand what is causing ...
7
votes
2answers
328 views

Online Index Rebuild of large table takes exclusive lock

I'm trying to rebuild the clustered index of a large table (77GB) on Azure SQL Database. There is high concurrent transactional activity on the table so I'm using the ONLINE=ON option. This has worked ...
0
votes
0answers
13 views

SQL Server Persisted Computed Columns, Issues during Mass Insert or Update?

I have a database with a computed, persisted column which validates columns, checks if its an integer, and converts. Sometimes streetnumber is alphanumeric, like 5C, other times it's simply an integer....
1
vote
2answers
64 views

Best practices for providing PHI/PII data to users in organization

I am looking for best practices for how to share data from a SQL Server database that contains PHI/PII to individuals that cannot view PHI/PII. In short, we maintain a SQL server database that ...
0
votes
2answers
55 views

Multiple Indexes and Tuning

I'm utilising Azure SQL Database 2019. Let's say I have columns A-F and the following indexes. Primary Key (clustered): A Index 1: B (ASC),C (ASC) Index 2: B (ASC) If I wanted to run run the ...
0
votes
0answers
22 views

Syntax error in adding a job step in Azure SQL Job Agent

I am inserting a job step in Azure Elastic job agent. This is my code: EXEC jobs.sp_add_jobstep @job_name='Sample T-SQL', @command=N' declare @columns varchar(max) select @columns = stuff(( select '],[...
0
votes
1answer
64 views

Update large table with millions of rows in Azure SQL Server, in Parallel

We have a large ProductOrders table with many rows, and plan to update it. The table has range of ProductType Ids from 1-1000. Table has around 2 million rows, 15 columns. Common ProductOrders table: ...
0
votes
0answers
25 views

How many tempdb data files required for this

you have SQL Server 2019 on an Azure virtual machine that runs Windows Server 2019. The virtual machine has 4 vCPUs and 28 GB of memory.you scale up the virtual machine has 16 vCPUSs and 64 GB of ...
1
vote
1answer
44 views

Execution plan of on-premises sql server and Azure sql server is not the same

I've been having some problems with moving databases from on-premises (2014 sql server) to Azure sql server. It's using the exact same database structure and data, but for some reason the query uses a ...
-1
votes
1answer
22 views

Create store procedure to disable and enable indexes

I have two below queries to, first of all, disable indexes and in another query enable them. Here are my queries --Disabling indexes DECLARE @my_sql2 NVARCHAR(200); DECLARE cur_rebuild CURSOR FOR ...
1
vote
1answer
57 views

High WRITELOG wait on Azure SQL Database

My WaitStats analysis of our Azure SQL Database is showing WRITELOG and HADR_SYNC_COMMIT as counter the highest wait. This is a Premium 250 eDTU resource. Script SELECT TOP (10) wait_type, ...
0
votes
1answer
55 views

Azure SQL database query performance degradation

I have a Azure SQL database (compatibility level = 150). I'm running into a performance problem executing a database query. So after I've rebuilt all my indexes, the query runs fast. When testing, ...
-2
votes
1answer
23 views

What are some good SQL Server Performance Metrics from System Views?

I am working on a project where I need to collect as many SQL performance metrics as possible, all from system views. I currently have collected, and in parenthesis the system view from which I have ...
10
votes
5answers
749 views

string or binary data would be truncated in table '******', column '******'. Truncated value: '******'

One of our applications report on error message 2628: string or binary data would be truncated in table '******', column '******'. Truncated value: '******' instead of String or binary data would be ...
0
votes
0answers
39 views

Select Changed Rows in MySQL and Postgres without Timestamp column

I have the following scenario: I have 2 source systems, one running Postgres, the other running MySQL. An ETL process (using Azure DataFactory and Azure Integration runtimes) runs the Extract for a ...
3
votes
2answers
58 views

Can't connect to Azure SQL with error 18456

I'm trying to grant access to my Azure SQL database (on an elastic pool) to an external developer using SQL Authentication. In the database (not master) I ran the following commands: create user [...
0
votes
1answer
27 views

SQL Server Linked Server to Azure SQL using Azure AD

I am trying to set up a linked server from an on-prem SQL Server to an Azure SQL instance. The Azure SQL instance uses Azure AD for authentication. When we attempt the connection we get this error ...
1
vote
1answer
37 views

Why Azure SQL Server table used space is too high?

I have two tables in my SQLServer database (azure managed), and the structure of two tables as below (for easy reference renamed them) dbo.TABLE1 CREATE TABLE [dbo].[TABLE1] ( [ID] ...
1
vote
1answer
46 views

Azure tempdb filling up while trying to convert a large table to columnstore… how to mitigate?

I have a large reporting table (approx 6B rows) taking up roughly 400GB of storage on an azure sql db. I've been trying to convert it to a columnstore table using the following commands: insert Logs(...
1
vote
1answer
50 views

What would cause an elastic pool to exhibit high “Sql Server process core percent” metricsj, but low DTU / CPU

Backstory: We have an azure sql elastic pool with several databases in it and around 750GB of data. We've been having some sporadic outages which correlate with the metric "Sql Server process ...
0
votes
0answers
37 views

Azure mysql user connections with proxy sql

I’ve looked for a couple of days, and can’t find a definitive answer. I have an application running on a kubernetes cluster that wants to connect to an Azure Database for MySQL server via proxysql. ...
-1
votes
1answer
38 views

is it a good idea to migrate a SQL Server database that uses a lot of linked servers and external conenctions with different databases to Azure?

We have a 1tb database that use information from other 4 or 5 databases. It has hundreds of procedures using external databases to calculate and etc. we have 0 problems inside SQL Server. I would like ...
0
votes
1answer
68 views

Azure SQL Hyperscale, Very Large Tables, and lack of explicit partitioning

Hyperscale scales to 100TB when it comes to storage. And I understand the page server concept - each server handling 128GB of data, with its own local cache. What I do not understand though is how ...
2
votes
1answer
121 views

Why is my recursive CTE so much slower on Azure SQL?

I have this simple recursive CTE for a hierarchy of folders and their paths: WITH paths AS ( SELECT Id, ParentId, Name AS [Path] FROM Folders WHERE ParentId IS NULL UNION ALL SELECT ...
1
vote
2answers
26 views

Temporarily Turn Off Table Type Reference Checking On A Development Database

During my database design process I have begun to add Table Types to the database and have run into the need to alter a table type. It is painfully clear that one cannot remove or drop the table type ...
0
votes
1answer
22 views

How to put MAX() inside AVG() in SQL

So I am having SQL error: "Cannot perform an aggregate function on an expression containing an aggregate or a subquery." I know you will ask me to just put it on a variable but this piece of ...
0
votes
1answer
17 views

manage backups azure sql option

This may be a silly question but I recently created an azure sql database and I need to check the backup policy but I cannot find the option manage backups that the documentation shows as you can see ...
1
vote
1answer
31 views

Will this trigger always complete before returning results of Insert to client?

I have the following trigger for Auditing. CREATE OR ALTER TRIGGER dbo.TR_MyTrigger ON dbo.Cust AFTER INSERT, UPDATE, DELETE AS BEGIN SET NOCOUNT ON; DECLARE @EntityState AS SMALLINT; ...
0
votes
1answer
26 views

Check constraint age 18< [closed]

Hello I need to create a constraint that chekc the user is 18< before listenning to certain songs but idk how... I tried this : ALTER TABLE Historique_ecoute DROP CONSTRAINT IF EXISTS ...
0
votes
1answer
45 views

Same query but different plan on different server

I have recursive CTE query, it was taking 30s to execute, after investigation I found out that a column (Name) with datatype nvarchar(MAX) was the problem so I changed it to nvarchar(1024). After ...
0
votes
1answer
23 views

Azure SQL: Should Manual Indexes be Applied with automatic tuning?

Should Manual Indexes on tables be applied in AzureSQL Cloud Database? We read that AzureSQL does automatic tuning, so are manual indexes even required? We read, there can be cases where AzureSQL ...
0
votes
0answers
12 views

Is 'data corruption occurs in the clustered index' still open?

Based on sp_Blitz Result: DBCC CHECKDB Not Run Recently, there is a reported bug in SQL Server 2012 & 2014, Data corruption occurs in the clustered index when you run online index rebuild in SQL ...
4
votes
1answer
554 views

How can I log which queries are in a distributed transaction on an MS SQL server?

I am looking at migrating a database from a self-hosted cluster to Microsoft Azure SQL. I am aware that there are a few distributed transactions involved, which isn't supported on Azure SQL. Is there ...
0
votes
0answers
19 views

Query store : same sql text with different query_text_id?

I'm investigating some issues with parameterization for our app, which uses Sql Azure. I'm using the query store and analyzing the following 2 queries, which are similar. See following image: There ...
0
votes
1answer
38 views

Does auto increment on Primary Key prevent concurent inserts? [duplicate]

I have a Sql Server logging table, that continuously is being inserted into, I want to revise the design of this table. Currently, we are using a GUID as the PK, because the software can generate ...
2
votes
1answer
61 views

Optimization of a query to retrieve records randomly with multiple joins and filters

I have the following schema: This question was posted also in StackOverflow, but I want to consult also to specialists more focused on DB administration because the nature of my project. Sorry if ...
0
votes
0answers
17 views

Why is @@VERSION different from Compatibility Level in Azure SQL?

I have just created a new Azure SQL database and when checking the SQL Server version in the Object Explorer tab I noticed it says it's 12.0.2000.8. However, I thought all Azure SQL databases are "...
-2
votes
1answer
20 views

Trigger for last inserted value [closed]

Can anyone help me create a trigger that appends the last record from table Sensordata into Lastsensordata. I only want 1 value per ConnectionDeviceId and the value needs to be the last inserted one. (...
3
votes
1answer
99 views

Complex key constraint: allow only if uuid is new or another column matches

For my use case I am trying to get something like this to work with Azure Data Factory (ADF) but I'm also interested in this question from a theoretical perspective. Is it possible to do something ...
0
votes
1answer
25 views

After a point-in-time restore, is there any way I can get the transactions during restore time?

The hypotethical scenario: Imagine that I have to do a point-in-time restore of a Azure SQL database, the original one is called DatabaseA and the restored is after restore called DatabaseA_restored. ...
1
vote
1answer
51 views

Reducing table size during initial load with ADR in SQL Server

When a table is created, and loaded with data from scratch based on a file, the table size changes significantly when Accelerated Database Recovery is on in SQL Server (realized based on my question ...
1
vote
1answer
55 views

Table size in Azure SQL Managed Instance vs On Premise SQL Server

In doing a test, I have observed that the size of the same table with the same exact DDL (created from scratch) with the same exact data (10M rows) varies drastically in our Azure SQL Managed Instance ...
1
vote
0answers
27 views

Secure connection strings to a Azure MSSQL server

Forgive me, because I'm playing monkey-in-the-middle here. I write data migration systems. A customer has their data in a private MSSQL DB that is managed by a 3rd party. The 3rd party agreed to send ...

1
2 3 4 5
14