|
|
|
|
|
|
|
Question of the Day |
Today's question (by Steve Jones - SSC Editor): | |
What is Between? | |
I have a table of products in SQL Server 2022. There are sequential items in the table with ProductIDs of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. If I run this code, how many rows are returned? SELECT * FROM dbo.Products WHERE ProductID BETWEEN 4 AND 7; | |
Think you know the answer? Click here, and find out if you are right. |
Yesterday's Question of the Day (by Steve Jones - SSC Editor) |
How Many Can Be the Greatest I am trying to analyze a number of columns in a large table to determine the highest value for each row. In SQL Server 2022, we have the GREATEST function, which will return the greatest value from those columns passed in. How many columns can I include in an expression like this: select GREATEST( col1, col2, col3, ...) Answer: 254 Explanation: Up to 254 arguments can be included. Ref: GREATEST - https://learn.microsoft.com/en-us/sql/t-sql/functions/logical-functions-greatest-transact-sql?view=sql-server-ver16 |
Featured Script |
Stored Procedure Generation Script Deepam Ghosh from SQLServerCentral This script produces scripts for all the stored procedures in a database.
|
Database Pros Who Need Your Help |
Here's a few of the new posts today on the forums. To see more, visit the forums. |
SQL Server 2017 - Administration |
Modifying the fetch size for Linked Server - Hi, Problem: Pulling several million row table from Oracle DB into SQL server via a Linked Server takes too long: 28M rows and 2GB of data from Oracle to SQL server took 17 hours. (However we are able to scp via OS much faster: we get 3.5MB/s to 8.5MB/s; we transfer 3Gb file in about […] |
Alias of a SQL Server - Was hoping to get some help on setting up our SQL Server with an alias. Currently, we run reports off it and then output the files on a folder structure on the server. For instance, we run SQL Job "Create Employee Retention Report", and it exports a file to "D:\Reports\Employees\EmployeeRetentionReport.txt", which is a drive on […] |
SQL Server 2019 - Administration |
Transitioning AlwaysOn Availability Group to Synchronous Commit Mode - Hello, I have a SQL Server with an AlwaysOn configuration consisting of three replicas operating in asynchronous commit mode. I have received a request to switch to synchronous commit mode, but I am concerned about potential data loss risks. Currently, the database is in "Synchronizing" status. My question is: What will be the status of […] |
SQL Server 2019 - Development |
Window Functions in a View - Is there a trick to get a where clause filter to push into a view that has window functions that don't include that filter in the window function partition? |
SQL Azure - Administration |
Azure Database Watcher Monitoring - Hi, I’ve provisioned an Azure Database Watcher to monitor our 4 Azure SQL Managed Instance, using the free tier of Azure Data Explorer. However, I’m currently overwhelmed by the visual data and trying to understand which performance metrics are most critical—particularly regarding Compute. Could someone point me to a comprehensive guide or documentation that explains […] |
Editorials |
Patching the Patch - Comments posted to this topic are about the item Patching the Patch |
Can You Ask for a Raise? - Comments posted to this topic are about the item Can You Ask for a Raise? |
What is a Failed Deployment? - Comments posted to this topic are about the item What is a Failed Deployment? |
PostgreSQL |
How to add metadata for every record in Azure postgres tables - Hi, I have a situation in one of the applications I am working on where prior to going live in production, we are going to migrate data from legacy systems over the period of few weeks. And at the same time, there will be activity from users in this production application. i.e, new records generated […] |
Article Discussions by Author |
Stored Procedure Generation Script - Comments posted to this topic are about the item Stored Procedure Generation Script |
SQL Server 2022 - Administration |
One big server with multiple instances, or multiple smaller servers... - We're currently on SQL 2019 and will likely be looking to migrate to a newer version in a year or so (definitely before Extended Support runs out,) and I'm looking to try to save some pennies for the org. Currently, we host SQL instances for several different orgs and their applications (so multiple, often unrelated, […] |
CDC & Azure Managed Instances - Performance degredation - Anyone got any good advice for performance tuning CDC on a Managed Instance? We are seeing around a 30-35% performance degradation (mainly runtime), with CDC enabled in test. Done the usual, put the change tracking tables on its own file and file group, set the capture job to poll every second (to try and keep […] |
SQL Server 2022 - Development |
OpenQuery with Application Intent specified runs on primary node. - I have an Open query that runs on an Always On server via a linked server and does selects * only. Select * into #Temptable from openquery (linked server) The linked server in its connection properties specifies application intent as ReadOnly, so this query should run on the secondary node but we find that it […] |
average duration increasing inline with exec counts - As the title says , I've got a handful of stored procs where the avg duration rises and falls pretty much mirroring the exec count. I've looked to see if there's any blocking chains they're involved in and cant seen anything that would account for the behaviour. Whilst Id obviously expect total duration to do […] |
How do I add all the values in the column considering it to be in hh:mm:ss:ms - How do I add all the values in the column considering it to be in hh:mm:ss:ms Please help. |
| |
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved. [email protected] |