Get database size, used space, free space
Gets the size, amount of space used & unused, owner and modify date for all databases in a Sql instance.
2015-09-14 (first published: 2014-04-22)
4,447 reads
Gets the size, amount of space used & unused, owner and modify date for all databases in a Sql instance.
2015-09-14 (first published: 2014-04-22)
4,447 reads
In Datawarehousing, a normal scenario is eleminating duplicate records/rows or deleting duplicate records, here's the solution.
2015-09-11 (first published: 2012-10-31)
5,033 reads
2015-09-10 (first published: 2014-05-08)
4,859 reads
Simple T-SQL Script to know whether your SQL Server is running on a Physical box or a VM.
Note: This Script works only on 2008R2 SP1 and above.
2015-09-09 (first published: 2014-05-22)
4,805 reads
A script to create MERGE statements with data for specific tables.
2015-09-03 (first published: 2014-05-19)
5,187 reads
Performance Base Line Report from SQL Server DMVs and Perfmon counters
2015-09-02 (first published: 2013-02-04)
17,130 reads
Altering an indexed view will drop all indexes on it without warning, even if nothing is changed.
This will prevent accidental alters.
Script is divided into 4 parts, included testing and cleanup scripts.
2015-09-01 (first published: 2015-08-13)
981 reads
Returns server and instance information via a registered server query, regardless of SQL version.
This script is more of how to get the data, and not so much about the data returned by my choice of columns.
Tested on 2008+
2015-08-28 (first published: 2015-08-07)
1,337 reads
Generate Script from Logins of Sql Server to recreate in another instance
2015-08-25 (first published: 2015-08-10)
1,740 reads
In this article, I would like to demonstrate about Filestream and FileTable implementation in SQL Server 2012.
2015-08-24 (first published: 2015-07-24)
1,581 reads
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