I am trying to updated IDs in a table named Price, based on matches of IDs in a table named CW. Here is the SQL that I’m testing. UPDATE Price SET ISN = (case when CW.id_cd = ‘ISN’ THEN CW….
Tag: azure-sql-database
Azure LogicApp cannot get rowid from SQL Server
I have an Azure logicapp that connects to a SQL Server database in Azure. The table has a uniqueidentifier column as the primary key. In the logic app the delete or update requires the rowid in order to perform update, the primary key does not work here and throws an error when running, stating that the table does not have
Sql Azure stopped using index
Weirdest few hours using SQL Azure. We dropped the database from 50DTU to 20DTU and our CPU went through the roof. Turns out that one of our main indexes was simply no longer being used. The …
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 …
Remove duplicates and fix foreign keys in T-SQL
I have the following tables: Foo_1 Id | Created | Dupe 1 | 2019-01-01 | ‘one’ 2 | 2019-01-03 | ‘one’ 3 | 2019-01-01 | ‘two’ 4 | 2019-01-02 | ‘one’ 5 | 2019-01-02 | ‘three’ Bar_1 Id | BarId …
Wrong SQL Syntax; Incorrect syntax near ‘)’
I’m using Microsoft SQL Server Management Studio that’s hooked up to an Azure SQL database; usually, I’m used to using Oracle (It’s just a rookie mistake I guess). What exactly am I doing wrong? These …
SQL GetDate() returns wrong time
I am having an issue while using GetDate(), for some reason is not returning the right time (it is 7 hours ahead from the actual time) I am using AZURE and the Database is configured with the right location (West US). I will appreciate any help! I tried to run this script: Answer Azure SQL Databases are always UTC, regardless
Optimal way to concatenate/aggregate strings
I’m finding a way to aggregate strings from different rows into a single row. I’m looking to do this in many different places, so having a function to facilitate this would be nice. I’ve tried solutions using COALESCE and FOR XML, but they just don’t cut it for me. String aggregation would do something like this: I’ve taken a look
Keep local MS SQL 2008 DB table and remote SQL Azure DB table in sync
I have a dedicated server which hosts a Windows Service which does a lot of very heavy load stuff and populates a number of SQL Server database tables. However, of all the database tables it populates and works with, I want only one to be synchronised with a remote SQL Azure DB table. This is because this table holds what