How to Generate a Restore Script
There are multiple ways to accomplish a database restore. But if you wanted to restore a database from a script how might you accomplish that task quickly and accurately?
2017-08-01
4,704 reads
There are multiple ways to accomplish a database restore. But if you wanted to restore a database from a script how might you accomplish that task quickly and accurately?
2017-08-01
4,704 reads
Have experience editing and writing technical content? Redgate is currently hiring for their educational publishing site, Simple Talk. They're open to accepting remote workers, so if you're interested, there's no excuse not to go ahead and apply!
2017-08-01 (first published: 2017-07-28)
4,722 reads
The query store gives us a novel way of identifying those queries that are causing performance problems when they are parameterized by SQL Server for reuse. Although it is relatively simple to ensure that certain troublesome queries avoid the problem, it is laborious to identify these queries. Additionally, Query Store gives us the means to fix the problem for groups of queries by means of plan guides without changing the DDL at all. Dennes Torres explains the details
2017-07-31
5,234 reads
Execute scripts in a folder with a single click using SQLCMD and a batch file.
2017-07-28 (first published: 2015-11-19)
22,642 reads
Developers using SQL Server Express face a few challenges in their day to day work. One is that setting up and maintaining Express can be a daunting task.
2017-07-28
5,168 reads
Build and Operationalize scalable Predictive models and intelligent applications using SQL and R.
2017-07-27
1,621 reads
Before you report your conclusions about your data, have you checked whether your 'actionable' figures occurred by chance? The Kruskal-Wallis test is a safe way of determining whether samples come from the same population, because it is simple and doesn't rely on a normal distribution in the population. This allows you a measure of confidence that your results are 'significant'. Phil Factor explains how to do it.
2017-07-27
6,123 reads
Have you ever wanted to be able to see the actual transactions that are contained in the transaction log file? Greg Larsen shows you how to browse the transaction log using an undocumented function.
2017-07-26
5,228 reads
In this article we will show some common roles and queries related to Azure SQL Data Warehouse.
2017-07-25
5,099 reads
Complex data environments sometimes need new techniques to properly manage the information. See how Windocks can help with containers and SQL Server.
2017-07-25
348 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