Introduction to C# Scripting for SQL Server DBAs
Microsoft has introduced an interactive C# scripting technology inside the Visual Studio 2015 environment. In this post, Jeffrey Yao looks at how we can use this to perform SQL Server tasks.
Microsoft has introduced an interactive C# scripting technology inside the Visual Studio 2015 environment. In this post, Jeffrey Yao looks at how we can use this to perform SQL Server tasks.
When loading data with SSIS, sometimes there are various errors that may crop up. This article provides a solution when you get have a problem between Unicode and non-Unicode fields.
Today we have a guest editorial from Tim Mitchell that talks about security and communications with your customers. Ultimately it pays to be open and honest.
Feodor Georgiev explains how SQL Compare Pro makes it possible to automate the process of synchronizing a source and target database. By calling SQL Compare from a simple batch script, he shows how to make it work for a whole list of targets, one after another.
Without question, one of the most common tasks performed by Database Administrators (DBAs) is identifying and weeding out duplicate values in tables. Despite the inordinate number of queries written by other DBAs to locate duplicate values in their database tables, the real challenge is in locating a useable SQL statement to go by. Rob Gravelle presents a few solutions that will save you some time down the road.
Using an ORM with SQL Server introduces unique challenges. I have listed a few of my experiences, hoping it can help someone.
Execution plans explain all you need to know about query performance, and how to fine-tune. Sure, you can see them in SSMS, but what if you need to drill into to the important details? What about using DMVs, Extended Events or SET statements to get at the execution plans? To get the best use of execution plans you need to be able to get right information from the right plan at the right time. Robert Sheldon explains how.
SQL Server is growing as a platform and Steve Jones says that DBAs need to learn development skills.
This article will show you how to extract a summary of tables affected by deadlocks.
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