2013-12-02 (first published: 2013-11-18)
1,724 reads
2013-12-02 (first published: 2013-11-18)
1,724 reads
Creates Mirror State-Change Alerts for ALL mirrored databases on a server - can save hours when setting up multiple mirrored instances
2013-11-29 (first published: 2010-11-23)
4,182 reads
2013-11-25 (first published: 2013-11-15)
2,201 reads
Function for splitting the values in string, applying logic and concatenating back to string.
2013-11-21 (first published: 2013-11-11)
3,111 reads
Powershell code to interactively move cluster resources between nodes. Intended for Windows 2012 and SQL 2012.
2013-11-19 (first published: 2013-11-04)
2,395 reads
In this script, we can search a Field and Table in all databases on the server, returning the Field value.
2013-11-15
165 reads
Takes a given table and generates a UNION ALL'd set of rows from the table. Useful for copying small amounts of data without the need for SSIS or import/export wizard
2013-11-14 (first published: 2013-10-31)
1,202 reads
This script displays all data files within a SQL Server database with the following relevant properties: FileName, FileLocation, FileSizeMB, SpaceUsedMB, AvailableSpaceMB, %FreeSpace, FileGrowthMB and FileGroupName
2013-11-11 (first published: 2013-10-29)
1,546 reads
I'm no big fan of dynamic SQL or cursors, however there are times where they do the job.
2013-11-08 (first published: 2013-10-29)
1,845 reads
This script converts a numeric column index to an Excel column name (ex: AC)
2013-11-07 (first published: 2013-10-23)
2,070 reads
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 SQL Art, Part 4: Happy...
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?
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