Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
Availability Group - Planning to setup AG group between 4 replica's and 3 are located in the same DC and a DR node in different DC. Between Primary and SR1 it would be synchronous commit for Automatic failover and HA option. Primary Replica - Full, Diff and Log backups & Maintenance Jobs etc. Secondary Replica 1(Synchronous commit) - […] |
SQL Server 2017 - Development |
Substract 2 values - Hello, I would like to minus from rows. 'Other Cost' minus the rest of the rows. select 1 Period,'Main' Category,100 Value union all select 1 Period,'Cost' Category,5 Value union all select 1 Period,'OtherCost' Category,20000 Value I tried like this but is not working. Can someone guide me. select Period,Category , SUM(CASE WHEN Category='Main' THEN [Value] […] |
SQL Server 2016 - Administration |
SQL Server Agent issue - I am running into an issue and hoping to get some help. Every time I reboot my server, SQL Server service and agent starts automatically. I see that the Agent is running but when I run a job or any job, I get this error (See screenshot below). I then restart the SQL agent and […] |
SQL Server 2016 - Development and T-SQL |
Return incorrect numeric value - Hello, I have make this query to return the max numeric value from the right for adding +1 : SELECT CAST(Isnull(MAX(REVERSE(SUBSTRING(reverse(Ltrim(Rtrim(cod))),0,CHARINDEX ('-',REVERSE(Ltrim(Rtrim(cod))))))),1) + 1 as varchar)[NextNumber] From QNC (Nolock) Where qnc.cod LIKE 'NCREC-CL'+'.'+'CMP' + '-'+'%' --This Return : 10 that is incorrect, the correct value must be 11 --if i modify my query and Group […] |
Counting Instances in TEXT - Hello Community, I have been presented with the following SQL challenge Find the number of times the words 'bull' and 'bear' occur in the contents. We're counting the number of times the words occur so words like 'bullish' should not be included in our count. Output the word 'bull' and 'bear' along with the corresponding […] |
Administration - SQL Server 2014 |
how to checkf if SQL Server CPU/RAM has bottleneck - how to checkf if SQL Server CPU/RAM has bottleneck? thanks! |
service broker endpoint in disabled or stopped state - I had posted a thread some time back and since that didn't lead anywhere, trying to find answers again. Have a alwaysOn group to host sharepoint (SP) databases. SP was set up to use the cluster name for connection. But we noticed that when the failover occurred SP still pointed to the previous primary. So, […] |
Development - SQL Server 2014 |
SELECT Name column from Name Table from either of 2 columns in main table - I have a table that selects an ID Username from the user's Loginname and another ID that gets that info from a program dropdown. The original design saved only the LoginName. Later the additional filed was added for users that login with a generic login. My problem now is how do I display the actual […] |
CASE Statement with Dates in WHERE clause - I have a column [BatchDate] that contains dates in text format: 032221 032121 032021 031921 etc.... For days Tuesday, Wednesday, Thursday, Friday, I'm trying to get results on just those days. However, on Monday, I want results from Friday, Saturday, Sunday, Monday, to catch weekend orders. I'm not getting the syntax correct. As well, there […] |
SQL 2012 - General |
how to do the following operation while the tables under different schema? - how to do the following operation while the tables under different schema? for example, there are two tables with same name but under different schema in the same database, one table saletable under schema A and the other table saletable under schema B, how to do this operation , such as sp_helpindex , sp_spaceused and […] |
SQL Server 2019 - Administration |
Unable to force Queryplan in QueryStore, failure 8695 - The queryplan looks forced but it's not used. Looking in "sys.query_store_plan" it says last_force_failure_reason = 8695 and last_force_failure_reason_desc = 'GENERAL_FAILURE'. The code 8695 doesn't seem to be documented anywhere (not even MS as far as I can see). Anyone knows better? Thanks alot in advance |
Amazon AWS and other cloud vendors |
use SCT to synchronize schema - Hello , I did a SQL database migration to RDS AWS DMS there were missing objects (index, foreign key, founction) Can I use SCT AWS Schema Conversion to add these objects? thanks |
General |
How can I let system use more CPU and RAM of SQL Server ? - I have a system, when I perform one function (nobody uses this server), it works very slow, but I check the SQL server database(SQL server is 2005 ) CPU Utilization rate is about 15%, and RAM usage is low 6.5GB, the total RAM is 16GB. why the CPU and RAM utilization rate is so low? […] |
SQLServerCentral.com Announcements |
Email Issues - 23 Mar 2021 - We are experiencing some email issues with our provider, apparently from SPAM reports and filters. Since we are entirely opt-in and do not purchase any emails, we hope this is a misconfiguration that is resolved quickly. |
MySQL |
Time n Date(Metrics) - I have the following code for time and dates metrics: SELECT DATE(o.created_datetime) as Date, o.store_uid as 'Store UID' , o.uid as 'Order' , o.rating as 'Rating' , IF(o.accepted_datetime < o.driver_ready_datetime, TRUE, FALSE) as 'Switch' , timestampdiff(minute, o.created_datetime, o.accepted_datetime) as 'Accepted Order' , if(accepted_datetime < driver_ready_datetime, timestampdiff(minute, o.accepted_datetime, o.driver_ready_datetime), timestampdiff(minute, o.created_datetime, o.driver_ready_datetime)) as'Invoiced Order' , timestampdiff(minute, […] |