How Old Are Your Database Statistics?
Unlike fine wine, database statistics do not improve with age. I recently helped out with a client who was having...
Unlike fine wine, database statistics do not improve with age. I recently helped out with a client who was having...
This article describes a way to parse a result set in SSIS using For each loop container, variables and SQL task.
Today Steve Jones has a little fun with titles in technology, and what we might start to call ourselves instead of DBAs.
Cursors provide a means of processing through a set of records row-by-row. However, many companies have a policy against using cursors in their SQL Server standards. This article examines the problem with cursors and alternatives to using them.
Utilize simple boolean algebra and nullable parameters to implement conditional WHERE clauses without dynamic SQL.
Using the Trace Management objects API it is possible to capture the events happening on SQL Server or indeed Analysis Services. I got to thinking that this would be a good thing to stream out in real time in StreamInsight and do some analysis “In Flight”. So here is a short video of me doing just that.
Steve Jones talks about the SQL Community and why it's so great. Hint: it's the people.
A great new project kicked off by MVP Arnie Rowland is available to people out there struggling with their careers, but looking to continue to grow them.
Why should I care and why should the database enforce it? This article from Jamin VanderBerg gives some reasons why the database is the place to enforce rules that ensure integrity.
Not a sound from the pavement. Have you ever come across a SQL query that used to run faster? Has that...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
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,...
Comments posted to this topic are about the item Extreme DAX: Take your Power...
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
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