SQL Window Functions Series: LAG() and LEAD()
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
10,763 reads
Dive deep into the powerful SQL window functions, LAG() and LEAD(). Explore their intricacies, discover real-world examples, and avoid common pitfalls.
2023-12-11
10,763 reads
This article describes six performance metrics that ought to be central to your PostgreSQL monitoring strategy. By using a tool like SQL Monitor to track these metrics over time, and establish baselines for them, you'll be able to spot resource pressure or performance issues immediately, quickly diagnose the cause, and prevent them becoming problems that affect users.
2023-07-17
PostgreSQL monitoring is now supported by Redgate SQL Monitor to improve performance and reduce downtime.
2023-05-26
Haven't seen SQL Monitor in a while? If you'd like to see how it enables you to always have the answers to the health of your estate, and proactively find potential problems before they impact your users, here's a 30 minute demo for you to watch whenever it suits you.
2022-06-29
A third-party database monitoring tool is an investment that drives enormous value for the bottom line of your business in ten key ways. Here's how a tool like Redgate SQL Monitor can save you money, time and assist with security and compliance concerns.
2022-06-20
SQL Monitor works with your SQL Server data, wherever that data exists, from local instances to AWS RDS and AWS virtual machines. You can keep an eye on your estate, regardless of where the data is.
2022-06-17
With our four dedicated development teams, weekly updates and a commitment to listening to your feedback, SQL Monitor keeps getting better and better! If you haven't looked at it for a while, you might just be pleasantly surprised with how far it has come and how it can help your team work smarter. Take a look at the key features - and benefits - we've added since 2018 in this interactive infographic.
2022-03-04
In case you missed it: IDC’s recent Global DataSphere Forecast, 2021-2025, predicts that global data creation and replication will experience a compound annual growth rate (CAGR) of 23% over the forecast period. But what’s causing the growth? Where will all of that extra data be stored? And how should we, as data professionals, prepare for it?
2022-02-18
In a total 180° turn, find out which Redgate product Grant Fritchey wanted to get rid of a few years ago, why he changed his mind and why it's now one of the reasons he is so proud to work at Redgate!
2022-02-16
With 92% of organizations now reported to be multi-cloud, a well thought-out approach to cloud migration is imperative. Download our final insights report in this series on database monitoring to find out how 2500+ of your peers are dealing with the challenge.
2021-12-20
It is Friday, the queries are running, and nobody is watching the bill. That...
By Steve Jones
Annabel retired from Redgate Software this week. Across most of my career at Redgate,...
By Tim Radney
As a SQL Server DBA with years of experience tuning production environments, I’ve seen...
Comments posted to this topic are about the item What is the Cloud?
Comments posted to this topic are about the item Changing the Schema
Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...
I set up a few users on my SQL Server 2022 instance.
CREATE LOGIN User1 WITH PASSWORD = 'Demo12#1' CREATE USER User1 FOR LOGIN User1 GO CREATE LOGIN User2 WITH PASSWORD = 'Demo12#2' CREATE USER User2 FOR LOGIN User2 GO CREATE LOGIN User3 WITH PASSWORD = 'Demo12#3' CREATE USER User3 FOR LOGIN User3 GOI then created a schema that one of them owned. Under this schema, I added a table with some data.
CREATE SCHEMA MySchema AUTHORIZATION User1
GO
CREATE TABLE Myschema.MyTable(myid INT)
GO
INSERT MySchema.MyTable
(
myid
)
VALUES
(1), (2), (3)
GO
SELECT * FROM MySchema.MyTable
GO
I granted rights and verified that User2 could access this table.
GRANT SELECT ON Myschema.MyTable TO User2 GO SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOThis worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3; GOWhat happens with this code?
SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOSee possible answers