Here's a few of the new posts today on the forums. To see more, visit the forums.
|
SQL Server 2017 - Administration |
SQL Query issues - different conditions in the SELECT list - If this is the wrong forum, please let me know. In SQL Server 2017, I have several tables that I need to join together to create one query that looks like this: Country EmailCount RecordCount PercentRecords USA 50000 5000 10.00 Brazil 40000 7500 18.75 Germany 30000 25000 83.33 Tables and applicable columns MailboxSummary Contains […] |
SQL Server 2017 - Development |
Splitting a group up into multiple groups using a score.... - Splitting a group up into multiple groups using a score for how many times an item should appear in a sub group This is related to betting, and whilst I do alright by myself I want to remove human bias from my main income which is making money from football accumulators. I have a table […] |
SQL Server 2016 - Administration |
T logs increasing - Hi In one of our servers the t-logs of one of the database which is in full recovery mode and with hourly log backups has increased im not able to find the exact error/cause for this from the event viewer or logs can anyone let me know where else do i have to check Thanks […] |
Kick starting Extended Events - We have no prior experience of using XE. Yes, our DBA group uses server side traces, sp_whoisactive collections, and more. Yet none of us yet have dived deep enough into XE to make momentous decisions. What would you advice we start with? what Sessions/templates/ should be the first one we launch for starters? and should […] |
Questions about Always On - Dear all, I have the following questions about SQL Server Always On: How does SQL Server copy data changes from the primary node to the secondary nodes? Through log shipping (backup & restore transaction log)? Or bitwise copy (copy all the changes in bit level)? It seemed Microsoft hasn't tell us. Many people ask me […] |
What is the best way to see Deadlocks info and take advantage of analyzing it? - There was a 5 minute periods of time the other day when the lasting blocking (chains) caused by 1 spid culprit were really numerous, And then suddenly on minute 6 everything went through as if it was a clogged sewerage pile, and the CPU usage dropped and all, within seconds. And I am wondering how […] |
SQL Server 2016 - Development and T-SQL |
How to map out multi-level Supervisor/Employee relationship - No doubt this has already been answered and probably detailed many ways so I just need to know the right key words to find the post or a link if anyone has it. I'm trying to write a query that will show all levels of Supervisor to Employee relations ships where the relationships can go […] |
RunningTotal column not working - Hello, I need a little help with my query because they don´t work properly when i try to do a runningTotal column. This is my query: DECLARE @ContaI VARCHAR(15) DECLARE @ContaF VARCHAR(15) DECLARE @DataI DATETIME DECLARE @dataF DATETIME SET @ContaI = '6221' SET @ContaF = '6229999999' SET @DataI = '20210401' SET @DataF = '20210531' […] |
SQL 2012 - General |
A really silly question - Hello. Sometimes when working on SQL server, i accidentally press something on my keyboard, after which if i put my mouse cursor in a middle of a string, press any letter or number, and that letter or number will replace a letter that was already in that string, instead of inserting it, and "pushing" the […] |
incorrect syntax near as when make pivot so How to solve it ? - i work on sql server 2012 when implement pivot i get error incorrect synatx near as but i don't know what is issue this is my code : DECLARE @result NVARCHAR(MAX) DECLARE @col NVARCHAR(MAX) DECLARE @sqldata NVARCHAR(MAX) ----------------------- set @result = ( SELECT SUBSTRING((Select ',['+FeatureName +']' AS [text()] FROM extractreports.dbo.allfeatures with(nolock) GROUP BY FeatureName,displayorder ORDER […] |
How to solve issue of Invalid length parameter passed to the LEFT or SUBSTRING f - I work on sql server 2014 I face issue error as Invalid length parameter passed to the LEFT or SUBSTRING function when run script below ? Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Enterprise Edition (64-bit) on Windows NT 6.3 I create table student with rows values insert as below : CREATE TABLE [dbo].[Student]( [Sno] […] |
SQL Server 2019 - Administration |
how to really patch a 24/7 always on - hi guys, i have a 2 node AlwaysOn. i need some confirmation on the step on how to keep the service still up while u go about patching it. all backup are up to dates. switch from automatic failover to manual verify sync is ok patch secondary replica reboot secondary replica switch AOGP to secondary […] |
HKCKP files \ sys.dm_db_xtp_checkpoint_files - Hi all, does anybody know how can I get rid of the old files in the folder: \$HKv2 under my data folder? I understand that they are InMem checkpoint files which I can see in this DM view: sys.dm_db_xtp_checkpoint_files under: relative_file_path for example : $HKv2\{85D9A12C-F870-4DCA-842A-FF2390683680}.hkckp I see files from the last 24 hours which consume […] |
SQL Server 2019 - Development |
How to troubleshoot PK Constraint violation - I'm hoping someone has seen this before because I've been doing this for years and never had this problem. When trying to add new records to synchronize a table I keep getting a violation of the primary key constraint. The primary key is on ContactID and using the query below I cannot understand how there […] |
Integration Services |
Whether to leave a clustered index on a staging table - Hi Using dataflows to load data from one SQL table to another (seperate databases; not an exact copy) Historically, best practice suggests loading data to a table that has no (nonclustered) indexes on it then adding the indexes post insert So, disable and enable When following the truncate destination and load method, what's the best […] |