Skip to content
Advertisement

Tag: azure-sql-database

How to extract value from middle of substring in SQL?

I have column called “CustomerId” with value “1_Nissan_028” and “2_Ferrari_035”. I would like to extract “Nissan” or “Ferrari” as “CustomerName”. CustomerName is located in middle of CustomerId and lenght varies. Following SQL query return values like “Nissan_” or “Ferrar”. How to write SQL statement? Answer Assuming that the value is always the 2nd delimited value, you can use STRING_SPLIT and

Is there an Azure SQL Database equivalent to MySQL’s “CHECKSUM TABLE”, and should it be used to check if two tables are identical?

I was looking for a way to check if two tables in the same database are identical (both contents and schema), and came over this question. The top answer for the question uses (from my understanding) a MySQL specific. When trying to run the code in an Azure SQL Database I get this error: Incorrect syntax near the keyword ‘TABLE’..

Take last value in sequence

I am trying to insert data into my target table from my source table where in the target table I have an additional column called SaleTo. SaleTo = the SaleFrom based on the MAX SaleSequence. Example of the source table: SaleNo SaleFrom SaleSequence 1 Alabama 2 1 Minnesota 1 1 Virginia 3 Example of target table: SaleNo SaleFrom SaleSequence SaleTo

Unable to log into Azure SQL database in Azure Portal using AAD Global Admin (member type) account

I am Global Administrator of the Azure subscription I own. Steps: I logged into Azure Portal using my credentials. I created an Azure SQL database (including initiating a new Azure SQL Server instance). I set the database security to permit both SQL Login and AAD Auth. I set my AAD account to be SQL Admin of the server. In the

Advertisement