Determine Easter Sunday
Determine what day easter sunday will be based upon the year you pass the function
2016-04-25 (first published: 2016-03-30)
471 reads
Determine what day easter sunday will be based upon the year you pass the function
2016-04-25 (first published: 2016-03-30)
471 reads
If you have job that opens a transaction and hangs too long causing a Prod issue this will be a big help to let you know.
2016-04-22 (first published: 2016-03-30)
719 reads
This is an version independent stored procedure to get the backup date from a backup file.
It's tested for SQL 2005, 2008(R2), 2012 and 2014.
Consider it a template to which you can add more output parameters from the headerinfo to meet your requirements.
2016-04-21 (first published: 2016-03-31)
371 reads
A stored procedure to generate database file moves along with Robocopy script and the attach / detach scripts
2016-04-20 (first published: 2016-04-04)
664 reads
This stored procedure will show all possible datetime formats when used with the style argument in the CONVERT() function. It also shows sample output from the date part arguments.
2016-04-13 (first published: 2014-10-10)
2,506 reads
2016-04-12 (first published: 2014-03-12)
2,395 reads
Generates Scripts to move DB files from one location to another SQL and powershell scripts
2016-04-11 (first published: 2014-03-19)
4,296 reads
This can be used for data warehouses as well as truncating table with foreign key constraints.
2016-04-08 (first published: 2014-07-07)
2,638 reads
Sometimes you want to copy all the alerts that you've got set up on one server to add them to another
2016-04-06 (first published: 2014-05-13)
6,178 reads
New set-based T-SQL solution for Sudoku puzzle using binary data and bitwise operations.
2016-04-05 (first published: 2015-06-08)
1,939 reads
By Steve Jones
It’s Prime Day. A few of my recommendations, since I want to do some...
With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...
If you’ve been watching AI roll through the data community and thinking, “this seems...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp:0818-751-777 Jl. Kalierang No.Ruko 3-5, Dukuhturi, Kec. Bumiayu, Kabupaten Brebes, Jawa Tengah 52273 (@bcakcpbumiayu)
WhatsApp:0818-751-777 Menara Satu Sentra Klp. Gading, Jl. Boulevard Bar. Raya No.1 Lt. Dasar, 1,...
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