azure-sql-database

freeTDS on Linux and Azure database, login issue

只愿长相守 提交于 2020-01-15 23:02:35
问题 I try to connect to Azure database like: tsql -H XXXXXX.database.windows.net -p 1433 -U mycorrectusername but I got message Msg 20004, Level 9, State 0, Server OpenClient, Line 0 Read from SQL server failed. Msg 20014, Level 9, State 0, Server OpenClient, Line 0 Login incorrect. There was a problem connecting to the server It is possible that I cant login because I have to choose database first. I have to, when I log in via website. When I try to choose database like: tsql -H XXXXXXXXX

Publish to SQL Azure fails with 'Cannot drop the external data source' message

こ雲淡風輕ζ 提交于 2020-01-15 10:45:27
问题 I've got an SQL Project (.sqlproj) in my solution with target platform 'Microsoft Azure SQL Database V12'. Recently I've added an external data source and several external tables targeting this data source. ExternalCSVLists.sql file: CREATE EXTERNAL DATA SOURCE [ExternalCSVLists] WITH ( TYPE = RDBMS, LOCATION = 'location.windows.net', DATABASE_NAME = '$(CSVLists)', CREDENTIAL = RemoteConnectionCredential ) Example of external table ( IntegerListContent.sql file) CREATE EXTERNAL TABLE [WebApp]

Not able to open Azure SQL Server DB immidiately after the creation

天涯浪子 提交于 2020-01-15 09:51:07
问题 I am trying to automate the tenant DB creation in Azure SQL Server. DB has been created/copied as CREATE DATABASE {0} AS COPY OF {1} ( SERVICE_OBJECTIVE = 'S2' ) Immediately adding a record to one of the table in the same. Getting error as: Function completed (Failure, Id=1046eae2-c07a-4eee-9a1d-886e89ab5071) A ScriptHost error has occurred Exception while executing function: Functions.CreateTenant. .Net SqlClient Data Provider: Database 'tenant8' on server 'dbserver' is not currently

Loading CSV from Azure Data Lake (Gen 2) to Azure SQL Database

馋奶兔 提交于 2020-01-15 06:40:24
问题 I have an Azure Data Lake Storage (Gen 2) account with several containers. I would like to import the salesorderdetail.csv file from the Sales container into an Azure SQL database. I've successfully built the same process using Azure Data Factory, but I now want to try and get this working via standard T-SQL statements only. CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'XxxxxxXX#' CREATE DATABASE SCOPED CREDENTIAL MK_Cred_Data_Load WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = 'sv

Query CosmosDb Unstructured JSON

假如想象 提交于 2020-01-15 05:13:29
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Query CosmosDb Unstructured JSON

偶尔善良 提交于 2020-01-15 05:13:10
问题 How can CosmosDB Query the values of the properties within a dynamic JSON? The app allows storing a JSON as a set of custom properties for an object. They are serialized and stored in CosmosDb. For example, here are two entries: { "id": "ade9f2d6-fff6-4993-8473-a2af40f071f4", ... "Properties": { "fn": "Ernest", "ln": "Hemingway", "a_book": "The Old Man and the Sea" }, ... } and { "id": "23cb9d4c-da56-40ec-9fbe-7f5178a92a4f", ... "Properties": { "First Name": "Salvador", "Last Name": "Dali",

Azure SQL Database sandbox based on production

白昼怎懂夜的黑 提交于 2020-01-15 03:24:13
问题 I have a large Azure Sql Database. I need to provide a sandbox to a team that is a copy of the database, but allows them to create sql objects. The data in the sandbox needs to be up to date with production. I used elastic queries, but the performance is not ideal. I've looked at data sync, but the company requires AD authentication. Restoring production periodically as the sandbox is not ideal as the team does not want to lose their work. Any suggestions? I'm sure I must be overlooking

Unable to Add Azure DB Firewall Rule to Allow Build Server to Run Tests

落花浮王杯 提交于 2020-01-14 08:55:29
问题 We use a Visual Studio Online-hosted build server to automate our build process. As part of this I'm looking into adding unit and integration tests into this process. These tests require access to our SQL Azure DBs (2 of them, both on the same server), which in turn requires access through the DB server's firewall. I have a PowerShell script which uses New-AzureRmSqlServerFirewallRule to add IP addresses to the DB server, and these firewall rules are successfully showing up in the Azure

Why my Azure SQL Database indexes are still fragmented?

牧云@^-^@ 提交于 2020-01-14 05:40:16
问题 My company has committed the sin of using GUIDs as Primary Keys on our Azure SQL Database tables (it is actually worse than that: we used VARCHAR(36) instead of UNIQUEIDENTIFIER). As such, we end up with fragmented indexes. They looked like this: CREATE TABLE OldTable ( Id VARCHAR(36) PRIMARY KEY CLUSTERED NOT NULL DEFAULT NEWID(), CreateTime DATETIME2 NOT NULL, ... ) I "fixed" the problem by creating new tables. This time, I used an immutable, ever-increasing DATETIME2 (e.g. CreateTime)

Loading file from Azure Blob Storage into Azure SQL Database using BULK INSERT

旧巷老猫 提交于 2020-01-14 03:12:06
问题 Following this announcement https://azure.microsoft.com/en-gb/updates/preview-loading-files-from-azure-blob-storage-into-sql-database/ I tried the example as such provided in this GitHub sample and receiving the following error, -- Create credential with Azure Blob SAS CREATE DATABASE SCOPED CREDENTIAL xxxstorcred WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = '?sv=2015-12-11&ss=bfqt&srt=sco&sp=rwdl&st=2017-03-14T17%3A52%3A00Z&se=2017-05-31T16%3A52%3A00Z&sig