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
Tag: azure-sql-server
Logs of executed Query in SQL Server
Database having 5 users All users are running queries on database we need to find what are the things all users doing like (Query , session_id,starttime , endtime,Database name,username , hostname ) we need to insert all the data into one table. Answer
How to use a function remove multiple possible prefixes from a Name string in SQL Server
I need to correct Names of users by removing prefixes for a report. I need to use a function here since there is an elaborate case logic in the report. I want to pass a first name with prefix and get …
How to aggregate and Join or Union into flat Json object with arrays?
I have data that looks like: Customers Table CustomerContacts Table Here’s the result I’m looking for: What I have tried: I’m embarrassed to say I’m not even close: Answer Unfortunately, SQL Server jumped on the JSON wagon a bit late in the game (started built in support only in 2016 version), which means it’s JSON support is still not great
Apply different Adjustment Factor for different date range
I have a Table with SalesPerson and Sales for different dates. I have another table where I have SalesPerson and multiple date ranges where different Adjustment factor needs to be applied. I can do …
How to find duplicates from Unique code column and delete the rows they’re attached too, while still keeping the original row?
I have a table in my azure sql server named dbo.SQL_Transactional, and there are columns with headers as code, saledate, branchcode code is my primary key, so if there is ever 2 or more rows with the …