Change the collation of Columns
This script changes the collation of columns to default database collation in all the tables
2010-09-02 (first published: 2010-09-01)
2,176 reads
This script changes the collation of columns to default database collation in all the tables
2010-09-02 (first published: 2010-09-01)
2,176 reads
Generates scripts to make text, ntext, varchar and char columns nvarchar/nchar
2010-08-30 (first published: 2010-08-26)
1,321 reads
2010-08-27 (first published: 2010-08-25)
3,676 reads
After scouring the site, and googling until my fingers bled, I finally put together a function that will return the dates when daylight savings time began/ended since at least 1990.
2010-08-26 (first published: 2010-08-19)
1,997 reads
Resets the identity seeds for all user tables to one plus the current maximum value of the identity field. Revised 24 August 2010.
2010-08-25 (first published: 2006-07-06)
385 reads
Summary information and metrics for any column in a given Table/View. Metrics include: number of records, distinct records, nulls, min, max, std, quartiles, kurtosis, skew, etc.
2010-08-24
52 reads
Fill a small Tally table with a 1 column primary key using GO keyword to repeat an insert.
2010-08-18 (first published: 2010-08-16)
1,557 reads
2010-08-16 (first published: 2010-03-05)
3,834 reads
Enterprise wide Backup Audit that produces backup information in a csv format.
2010-08-06 (first published: 2009-11-10)
1,842 reads
2010-08-05 (first published: 2009-11-25)
7,290 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 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