Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2016 - Administration |
Distributed AG DB movement - I have a DAG between On prem and Azure. We have a maintenance window coming up next week where networking team will be replacing some switches. It will cause internet outage for 4 hours. It will disrupt data movement between 2 servers. I have a plan where I pause DB movement in Azure before they […] |
SQL Server 2016 - Development and T-SQL |
Question about deadlock - Hello DBAs, I am facing some deadlock issue and after investigation from trace flag capture, found the processes involved. Both processes are running update but based on the parameter which defines different targets ( for eg. One update works on condition "where column1 = 'abc'" and other one on "where column1 = 'def'"). First Question […] |
SQL 2012 - General |
How to Update field updatedStuffDiff when i have different values for parts exis - I work on sql server 2012 I face issue I can't update column name updatedStuffDiff with different feature value for every feature based on partid so when i have two part have same feature but different values then display it as result on column updatedStuffDiff based on partidc and partidx on table #temp so result i […] |
Get Date Based on TimeOffSet and Day - Team I have a table which carries the below columns and values TimeOffSet Column > Values are : +00:00, -05:00, -04:00, -08:00, -07:00, -05:30 WeekDay Column > Values are: Sun, Mon, Tue, Wed, Thu, Fri, Sat, Sun Time Field Column> 02:00, 10:00, 23:00 Expected : I want to O/P which is the Date Field, Time […] |
SQL Server 2012 - T-SQL |
pivot on 2 fields - I'm trying to create a query that pivots on 2 fields(entity,channel) and produce a daily sum of charges per day. This gives me a daily total( I would like to remove any Null values from the display) for the month, but I want to break it down by channel within the entity, Data: src,200,02,01,400.00 xrb,200,02,01,500.00 […] |
SQL Server 2019 - Administration |
Name of the remote server in a query - Hi, I want to retrieve the name of the remote server in my SQL server query: exec ('CREATE OR ALTER PROCEDURE ins_tmp_proc AS BEGIN INSERT INTO dbo.tmp (job_id, name, ..., server) SELECT job_id, name, .., @@SERVERNAME from msdb.dbo.sysjobs UNION SELECT job_id, name, .., @@SERVERNAME from .msdb.dbo.sysjobs END') I tried executing just the SELECT statement by […] |
Problem with creating query for allocating amount - good day i came a cross of a problem I have a query that takes one line in table and if it math the condition in my situation is if Date and Tracking_Category_1 in table OLAP.VW_CUBE_Finance equal Date and Tracking_Category_1 in OLAP.test2 then it take line that have both condition and braek it in 3 […] |
MSDTC and Always On AG - Hi Experts, We are planning to implement 2 Node AO SQL Server 2019. For MSDTC what is the best practice? Do we need a cluster disk for MSDTC alone in this setup? https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/msdtc-best-practices-with-an-availability-group/ba-p/909429 |
Remove Carriage Returns / Line Breaks / Any other reason the "text" moves down - I know this has been covered ad nauseum all over the internet for years. But I have literally tried a dozen different possible queries to remove these and the scripts either run and do nothing, or remove WAAAY too much information. I am working with a company to extract data from a program that was […] |
Why are DBAs not paid for knowledge and other IT Professionals are? - DBAs are being asked to know everything for 6 figures which cap out for most at 135k a year with Senior experience. So, what does this mean, you get a DBA who knows a lot of everything, from hardware to development on all levels and certified but DBAs get little to nothing in return for […] |
SQL Server 2019 - Development |
Logic is not wokring - hi, I have 3 types of invoices , INNU,INN1, INN2 I am trying to filter out invoices that are "INN1" and "Unpaid" ( I dont want INN1 Unpaid invoices ) I tried to use the following condition but Its taking out all the "Unpaid" invoice. where [Invoice Class] IN (@invoice) and ( invoice_cl <> 'INN1' […] |
poor query performance by joining large table and new CE - We have a complex stored procedure working in our database. Some of the statements are executed with different query plans depending on database compatibility level / Trace Flags. The different query plans leads to very significant differences in execution time of that stored procedure (some seconds to more than one hour). See the linked QueryPlans. […] |
Problem with Logic for new column - Hi guys, I have the following table DDL/DML CREATE TABLE #DailyOnHandForecast (Id INT, ItemNo_ NVARCHAR(24), OH_Qty INT, OH_CONT Decimal (38,20), OH_$ Decimal (38,20), [Date] Date, Arrival_Date Date, [Forecast Daily Qty Sold] Decimal(38,20), [Forecast Daily COG] Decimal(38,20), [Forecast Daily Sales] Decimal(38,20), [Forecast Daily Container Sold] Decimal(38,20), [DayOOS] INT ) INSERT INTO #DailyOnHandForecast VALUES (387909,50363,29,0.08065,3042.05418,'2021-02-26',NULL,2.333,246.222,547,0.006489,NULL), (387910,50363,26,0.074161,2797.2912,'2021-02-27',NULL,2.333,246.222,547,0.006489,NULL), (387911,50363,24,0.067672,2552.52822,'2021-02-28',NULL,2.333,246.222,547,0.006489,NULL), […] |
Help query to select latest date row - Hi Guys I have the data below ( this is an example) and i am trying to create a query to pull the data to show the latest status of the city, i am struggling to do this so from the data above (this is an example , new daily data is added every day) […] |
SQL Server 2008 - General |
Better query to get count based on column value - I am using SQL server 2008 R2 express edition. Out of below 3 method which method is efficient to fetch count ? 1.select name,count * from table where name contains 'raj' and P = 1 select name,count * from table where name contains 'ram' and P = 1 merge result in code vs 2.select name,count […] |