Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
SQL input parameters are defaulting to nvarchar causing full table scans - When our applications are submitting SQL via ADO.Net, with input parameters, the parameter definitions are defaulting to nvarchar. If that field is defined as a varchar and an index on the database table, the index is not used resulting in a scan instead of a seek. We are converting from Teradata to SQL Server so […] |
SQL Server 2017 - Development |
SQL - How to compare data of a column while iterating row by row and insert new - I have the below data in an SQL Server(2017) table POS_ID Term Code Status IsActive TR 101 In Progress true TR 102 In Progress true TR 103 In Progress true CA 151 In Progress true CA 152 In Progress true DA 161 In Progress true The requirement is I want to iterate each row and […] |
SQL Server 2016 - Administration |
PARALLEL_REDO_WORKER_WAIT_WORK.: Not sure how relevant this may be.. - Attached file shows the top waits... PARALLEL_REDO_WORKER_WAIT_WORK.: Not sure how relevant this may be for this morning Latency reported by multiple users accessing a number of web pages and apps that connect to this server.. just seeing it first time But this wait type has been predominantly much higher than all other waits. Comparing to […] |
Distributed Availability group - Is there a guideline or does anyone have any step by step process on removing Distributed Availability group between 2 servers properly? I am trying to beak it a part because the secondary server (forwarder) is old and ready to be decommissioned. This is how servers are setup: DAG between SQL1P (forwarder) and SQL2P (primary) […] |
Administration - SQL Server 2014 |
What is reliable method to find all unresolved references? - I need to find all stored procedures that point to a table, function, a database that does not exist. I am using sys.sql_expression_dependencies built-in view for this. There are two problems with it. First, in some cases referenced object in this view is just an alias; and second, it happen to be a part of […] |
Data type Date - Previously we had some issues with deadlocks caused by transaction that happen so fast that the current timestamp column is not accurate enough to prevent a collision. To prevent such an occurrence we need to change the data type used by the timestamp column in order to make it more precise, both for existing tables […] |
SQL Server 2012 - T-SQL |
Put something into each row in a GROUP BY statement - I have this script, which gives me correct info : SELECT datepart(yyyy, [Første reg# dato]) AS årgang, COUNT(*) AS antal, Model,variant FROM dbo.[Ark1$] WHERE model <> '-' GROUP BY model,Variant,datepart(yyyy, [Første reg# dato]) ORDER BY DATEPART(yyyy, [Første reg# dato]),model,Variant A part of the result is: 1960 2 125-3 UOPLYST 1960 2 ES 250 1960 […] |
Updating from previous row until next value is found - I am trying to create an update that will update a value from previous row until the next none null value is found then update with that value. For instance in my table there are 2 columns SeqNum and AcctNum. The SeqNum will always start with 0000003 and the AcctNum will have a value and […] |
SQL Server 2019 - Administration |
Upgrade SQL 2017 to 2019 - Hi I guess this question has been asked before - but I failed to find best practice recommendation. We have a SQL Server 2017 and need to upgrade to 2019. The plan is to just install the 2019 instance on same physical SQL Server as a second instance. Then move databases from the 2017 […] |
PowerShell - ItemArray - Can anyone please explain to me what .ItemArray does in PowerShell? I read the doco but I don't understand it. I have an array of SQL instances using mixed names i.e. server.domain, server.domain\sqlinstance, server.domain\sqlinstance, portnumber I used a foreach loop to pass the items in the array to an Invoke-Sqlcmd statement. I couldn't connect to […] |
SQL 2012 AlwaysON migration - We have a SQL AlwaysON setup on windows 2012 R2 / SQL 2012 (to latest patch). We want to migrate to 2019. Can we add to the cluster and to the AlwaysON a Node3 and Node4 (Windows 2019 / SQL 2019) Then failover to Node3 and REMOVE Node1 and Node2. Will that migration work? Has […] |
Raising errors between 1 and 13000 - Hello, I've been struggling with a task which requires me to raise a number of errors for testing purposes. Of course the time consuming errors are between 1 and 13000. I've managed to do them, but I need to do it several times on multiple test instances and I wanted to ask if there's a […] |
Restore - what happens after 100% - Just curious. I restore databases very often as I am a developer. Some of them has a size, that means that it takes some time. I use to backup with the same version as I restore from. I am aware, that if i restore a SQL 2012 with a SQL 2019, the converting takes some […] |
Amazon AWS and other cloud vendors |
AWS Reserved Instance for Old Servers - We have a couple of SQL server instances(i2 and r3) from about 5 years ago. We are looking to reserve the instances now without upgrading to new, but I don't see any of these instances listed in the "Reserved Instance" section. In other words, the instances are not there to be purchased. I got to […] |
Reporting Services 2008/R2 Administration |
Table Performance Issues - Hi, there I have a SQL Server 2008 R2 database and recently I have had major performance issues (I am not a DB admin). The database is connected to a CRM and the CRM users call many queries through the CRM interface on the various tables in their day to day work. I was made […] |