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
4
votes
1answer
902 views

Cannot restore azure database to local due to missing master key

I create a bacpac from azure and restore to my local on-prem server. However, it throws an error like “Please create a master key in the database or open the master key in the session before ...
1
vote
1answer
143 views

SQL Server Web transaction replication to Azure SQL

In Features for SQL Server 2016, I see that Transactional replication to Azure is supported for Web edition. Following the instructions leads to Configure Publishing and Distribution In attempting to ...
3
votes
1answer
851 views

Generated bug data script how not to set the IDENTITY in the insert statements?

I'm using SQL Server Management Studio to generate sql script (big one) to update Azure DB. The problem is that the script is generated with IDENTITY on and the insert statements are exported with ...
0
votes
2answers
43 views

Maximizing Availability on a Table When Changing Data Type

I'm looking for some advice on the best way to change the data type on a column from an INT to a BIGINT on a table with 220 million rows, as it has reached the upper limit of the INT data type. The ...
2
votes
1answer
937 views

Remove index fillfactor for Azure migration

I'm deploying a SQL Server database to Azure. I've tried to export to a .bacpac, but receive an error: fill factor set and is not supported when as part of a data package Using the script in this ...
1
vote
1answer
362 views

How can you view the Query Store settings for a database?

I see that you can use notion like the following to set the query store configuration: ALTER DATABASE <database name> SET QUERY_STORE (SIZE_BASED_CLEANUP_MODE = AUTO); But how can I ...
16
votes
2answers
2k views

Why is my index not being used in a SELECT TOP?

Here's the run-down: I'm doing a select query. Every column in the WHERE and ORDER BY clauses are in a single non-clustered index IX_MachineryId_DateRecorded, either as part of the key, or as INCLUDE ...
1
vote
1answer
754 views

Boolean logic with BITs and Booleans in SQL Server

How can I mix boolean logic with bitwise and/or operators in SQL Server, specifically SQL Azure Database and/or SQL Server 2016? To demonstrate what I'm trying to do, consider the following script: ...
0
votes
1answer
80 views

How do I know an index is used for any queries?

I've found a likely abandoned index in the production database. It's not included into .sqlproj from which this database it usually deployed. Most likely it was created for some experiments and then ...
2
votes
0answers
217 views

Stage database in SQL Azure

I am designing a data warehouse using Azure Databases (not Azure Data Warehouse though), I have 2 databases: the main data warehouse and a staging database. As in a traditional ETL process, the raw ...
1
vote
1answer
425 views

Unnecessary Hash Match in Query

I've just migrated a database from SQLExpress (Entity, Database First) to Azure (Entity, Code First) and some of the indexes are missing because they werent migrated (on purpose, I think a lot of them ...
4
votes
1answer
1k views

No data in Azure SQL after importing bacpac file

I've created a bacpac file of my database for transfer to Azure. The file is uploaded and imported successfully but there's no data in the imported database. What did I do wrong? There don't seem to ...
0
votes
1answer
200 views

Combining nullif while checking if field is an integer with a case statement

As part of an ETL process, I need to copy a varchar field in table1 (staging table) which is meant to contain an integer value to a tinyint field in table2 (production table). However I am having some ...
4
votes
1answer
2k views

Is it possible to use cross database queries in both Azure and SQL Server 2016?

I'm working on a project that is designed to run on Microsoft's Azure platform. At present we have a few developers working locally on their own machines with the intent of being able to publish the ...
0
votes
2answers
104 views

SQL Query to delete while database size is larger than 200GB

I have a SQL table which is used to store a large number of logs. I want to have a stored procedure or something along the lines of that. That runs every minute and deletes items from the end of the ...
0
votes
1answer
530 views

Restrict contained SQL Azure user to read-only access

I am trying to create a contained user for a database in SQL Azure that only as read-only access. What I am doing is: Connecting to the database via SSMS using my admin account. Right click the ...
6
votes
3answers
614 views

Handle concurrency when insertion depends on reading

[Short] I have the following situation: user A attempts to insert data DA into the database. To check whether user A is allowed to insert DA, I need to run a query and do some computation. The ...
2
votes
1answer
1k views

Multi-tenant database

We are building a database for a SaaS web application. We have been told to use a multi-tenant approach and to expect over 100,000 tenants to be using the system over the next 5 years, so we're ...
2
votes
2answers
104 views

Ideal settings for "read only" table

I'm building an application where a certain group of programmatically-created Azure SQL Server tables will only ever be read from. The app will create a new table, insert a bunch of data, and then ...
0
votes
1answer
710 views

Azure SQL Databases hit cpu limits too quickly

Background in a nutshell: - We have a SAAS solution with the following main components. 1. We have a web-portal back-end where administrators can edit data. 2. We have a web API that is called by ...
1
vote
1answer
1k views

Azure SQL very slow INSERT in stored procedure [closed]

I have the following stored procedure, inserting new rows in a join table: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[InsertNewRows] @PropertyId int, @...
1
vote
1answer
55 views

Colloboration between T-SQL Table and Excel Sheet(s)

Let's say I have a T-SQL table with 20-30 columns and 2-3 millions rows (huge table). I want to allow a user to update this data directly (the solution must work for different tables). I generally ...
0
votes
1answer
395 views

What are options for Bi-Directional Replication of SQL Azure Database

This questions came from a developer friend who is working with SQL Azure Database. Scenario: There are two Azure DB servers, one in North America, USA region and another one in South East Asia ...
5
votes
3answers
6k views

CREATE DATABASE AS COPY does not work with Azure

I'm new with T-SQL and MSSQL but need to copy Azure SQL database from one server to another. As I googled here - it can be done with a CREATE DATABASE Database1_copy AS COPY OF server1.Database1; ...
4
votes
2answers
14k views

Add Active Directory User For Azure-SQL-DB

I have an active directory user LDomain\LUser and I want that user to be able to connect to Azure-Sql-DB. The syntax MS uses is throwing an error. T-SQL: CREATE USER [LDomain\LUser] FROM EXTERNAL ...
2
votes
1answer
230 views

Developing an Azure Sql Database backup strategy [closed]

I know Azure databases are backed up and kept for a retention period, which I believe the default is 30 days. I'd like to come up with a plan to mimic our current strategy with a physical SQL Server ...
4
votes
2answers
10k views

Azuredb The database 'tempdb' has reached its size quota

We are runnig a V12 Azure Database instance on the S3 tier. There is still about 100GB of a free space on the database. When loading 85MB XML file with SSIS running on a different non azure SQL server,...
7
votes
3answers
24k views

Inserting date from string: CAST vs CONVERT

Consider the following two ways to convert a datetime varchar string into a date field: SELECT convert(date, '2012-12-21 21:12:00', 20) -- Only date is needed SELECT cast('2012-12-21 21:12:00' as ...
0
votes
2answers
103 views

INSERT INTO FROM: Concatenating Forename and Surname when Forename can be blank,

I have a staging (RAW) table that contains one field for to hold a person's first name, and another for a person's last name. I want to insert those value on a production (DBO) table, where the person'...
3
votes
1answer
124 views

"Aggregation" by hour when data may be much longer or much shorter

I have duration data which looks like this: deviceid StartRange EndRange Duration eventname value 57a6f2499aaaeb1580f1ca36 2016-08-18 13:37:02....
0
votes
1answer
407 views

Setup Managed Backup failure

I am trying to setup Managed Backup (in Azure SQL) using SQLServer 2014 (Ent 64bit) and it is failing. I have the credential created with Identity as the Storage account name and Password set with ...
0
votes
1answer
660 views

Index maintenance Azure SQL

I have installed Ola's scripts: https://ola.hallengren.com/scripts/CommandLog.sql https://ola.hallengren.com/scripts/CommandExecute.sql https://ola.hallengren.com/scripts/IndexOptimize.sql and ran: ...
2
votes
2answers
6k views

SQL Server 2012 import/export wizard not showing at all

So I have access of two databases that are stored in Azure, and using SQL Server 2012 to access them. All I need to do is copy a table from one db and duplicate and create it in another. I keep ...
1
vote
1answer
28 views

Transactional Replication guidance

As a real newcomer to Transactional Replication I would appreciate some guidance. I have a production database on premise and the need to take two tables from here and copy them regularly to a SQL ...
1
vote
1answer
343 views

Replace all rows in a table based on date

I need to copy the values from a staging table into a production table in SQL Azure V12, considering the following rule: I need to replace all rows for a given day (see datefield column) in the ...
3
votes
3answers
4k views

SQLCMD: "Login failed for user" on SQL Azure, but it works with SSMS

I have an SQL Azure database, and I'm able to connect to it using SQL Server Management Studio. When connecting to it, it displays myServer.database.windows.net (SQL Server 12.0.2000.8 - myUser) ...
0
votes
1answer
48 views

Installing SQL Server 2016 for Azure development

Coming from a dev background, I'm not an expert in SQL Server. When installing SQL Server 2016, I have the option of installing three different components: New SQL Server stand-alone installation SQL ...
3
votes
2answers
2k views

What indexed view capabilities does Azure SQL Database have?

Does Azure SQL Database support indexed views? Does it support automatic indexed view matching without NOEXPAND? Does the answer depend on the pricing tier? I was unable to find definitive answers to ...
1
vote
2answers
100 views

Finding the row with the latest date for each row type

I've got an SQL database (SQLAzure V12 version running on Azure) that looks like the following: DECLARE @VehicleData TABLE ( id int PRIMARY KEY, Registration nvarchar(50) NOT NULL, [...
2
votes
1answer
855 views

Fastest method for inserting large number of records from query between tables

I have a query that returns 14 million results that I need to store in a table, the SELECT query itself returns in a little over 2 minutes but INSERT statement takes well over 30 minutes (which is ...
1
vote
2answers
1k views

Сopy rows from one table to another and replace duplicates in the process

I have a SSIS job that loads daily data from CSV files into a raw staging table in a SQL Server database (technically is an Azure SQL database). Then after that, a stored procedure is executed to copy ...
1
vote
1answer
74 views

XE_FILE_TARGET_TVF WaitType in Azure SQL

Recently I started exploring Azure Sql and came across waittype XE_FILE_TARGET_TVF. I tried searching online to get more info but didn't get enough information. I am just curious to know: What does ...
3
votes
1answer
3k views

CLR SQL vs T-SQL for queries

I am aware that CLR stored-procedures is more efficient in procedural code and T-SQL is better for queries - however I am having a hard time deciding what to use for my specific needs, and I would ...
3
votes
1answer
3k views

SQL backup to azure storage failed

I have a SQL Server 2014 up and running and I am trying to backup a specific database to Azure storage. I created a credential using the storage account name as identity and the primary key as ...
1
vote
1answer
210 views

SQL Server local instance user login [closed]

I am working on an Azure Mobile Apps backend service, which I am trying to connect to a local SQL Server database, as described here. I have followed all the steps, except I am using SQL Server 2016 ...
8
votes
3answers
18k views

"login failed for user " on SQL Azure from azure hosted web application

I have an Azure ASP.net MVC web application which uses a SQL Azure db. It was working fine for some months (someday for some reason Azure changed the name of the server and I had to set that again but ...
2
votes
0answers
783 views

Connection to Azure SQL from Java

I try to connect to Azure SQL with MS JDBC driver: import java.sql.*; public class ExampleSQLJDBC { public static void main(String[] args) { // Setting. String connectionUrl = "...
6
votes
1answer
8k views

How do you list all logins for Sql Azure?

What queries can I use to list all logins for a server and database in SQL Azure? I tried running select * from sys.sysusers but I'm guessing that's just showing the users
5
votes
1answer
909 views

Database_Id for our database in sys.databases does not match that of DB_ID ( '<our database' )

The Database ID in sysdatabases and sys.databases for our database is 4. The function DB_ID ( '<our database>' ) returns 5 for our database. Also any missing index data for our database in the ...
1
vote
2answers
69 views

List objects in SQL file

We are trying to migrate a database from SQL 2014 to Azure SQL. In SSMS, you can right click on the database and then on a task to "Deploy Database to Windows Azure SQL Database..". This task ...

1
11 12
13
14 15
17