Database State and Backup Information
Displays the current database state, the last backup taken, it's size, and days since the backup.
2010-04-22 (first published: 2010-04-20)
2,265 reads
Displays the current database state, the last backup taken, it's size, and days since the backup.
2010-04-22 (first published: 2010-04-20)
2,265 reads
Hi Sqlers,
Paramenter @Action, which will be Enable or disable to perform the requested action on triggers accross all tables in your sql db, this works on tables with schemas as well.
2010-04-19 (first published: 2010-04-14)
1,124 reads
SQL 2000 OnlyThis script will create a stored procedure and a table in the master database. Simply run the stored procedure and supply a database name as a parameter. It will do the following:1. Gather/Log DBCC SHOWCONTIG statistics (pre defrag)2. Defragment all user indexes in the database3. Gather/Log DBCC SHOWCONTIG statistics (post defrag)4. DBCC DBREINDEX […]
2010-04-19 (first published: 2003-03-19)
2,235 reads
2010-04-15 (first published: 2010-03-28)
14,957 reads
The Stored Procedure sp_whocpu shows cpu_delta - a metric I introduced to define the real time CPU activity
2010-04-14 (first published: 2010-03-28)
3,581 reads
The Stored Procedure sp_whoio shows DiskIO_delta - a metric I introduced to define the real time I/O activity
2010-04-12 (first published: 2010-03-28)
3,846 reads
This SP reports the status of your heap tables. It gives you an overview of fragmentation, ghost record counts and forwarded record counts. Another reason to create a clustered index!
2010-04-09 (first published: 2010-03-09)
2,174 reads
2010-04-06 (first published: 2010-04-01)
3,938 reads
2010-04-01 (first published: 2010-03-31)
4,381 reads
With this view you can obtain last failed job steps without using visual interface.
2010-03-30 (first published: 2010-03-19)
2,366 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...
WhatsApp: 0817839777 Kw. Industri Pulogadung, Jl. Raya Bekasi Km. 21, Ruko No.A2/18-19, RW.3, Wil,...
WhatsApp: 0817839777 Jl. I Gusti Ngurah Rai No.8 A-B, RT.8/RW.6, Wil, Kec. Duren Sawit,...
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