Replication

Technical Article

Find Database Schema and Objects Changes

  • Script

This procedure will execute, taking two parameters, (the 2 db names, and will then list out the major object and schema changes for you. It is pretty sraight forward and suggestions are appreciated. It's a good utility for a DBA to track changes after upgrades, etc.. Each portion is easily convertable to a stand alone […]

(1)

You rated this post out of 5. Change rating

2004-08-02 (first published: )

1,110 reads

SQLServerCentral Article

Log Shipping vs. Replication

  • Article

SQL Server high availability. Log shipping or replication, clustering or some other solution. It's a challenge and as companies grow more dependent on their databases, it's one that more and more DBAs face everyday. Paul Ibison has taken a look at how log shipping and replication can be compared in the quest for high availability.

(37)

You rated this post out of 5. Change rating

2008-06-27 (first published: )

66,430 reads

Technical Article

Script to automatically restore needed log-backups

  • Script

Given a backupfile with a lot of sequential log-backups, this script automatically restores just those backups out of the file, which are necessary to bring the database up to a given timelag relating to the original database.Params are path to backupfile, name of the db to restore to, timelag in minutes.

You rated this post out of 5. Change rating

2004-09-08 (first published: )

1,650 reads

Technical Article

Script to transfer logins to second server

  • Script

Modification of DR_Script_Logins.sql by Bruce Canady.Puts out a script to add new logins or change the password of existing logins.I insert the output into a table in my production-db.   insert database.dbo.login_table exec master.dbo.dr_script_loginsThat way its backed up with the data, and the logins can be restored anywhere by the script i added at the […]

(1)

You rated this post out of 5. Change rating

2004-09-03 (first published: )

2,537 reads

SQLServerCentral Article

Replication Gotcha - Columns with Defaults

  • Article

Some days the simplest things go wrong. On this particular day Andy tried to remove a column that was part of an article in a transactional publication, wound up in an inconsistent state that required a snapshot to fix. Deeper investigation reveals the cause and a work around.

You rated this post out of 5. Change rating

2004-05-25

7,555 reads

SQLServerCentral Article

Snapshot Replication for the Beginner - Part 2

  • Article

This article covers how to build the snapshot subscription without getting bogged down in too many low level details. You'll learn enough here to get started experimenting and get results. Depending on comments from you, we may ask Andy to move on to transactional replication or to dig deeper into snapshot options. Tell us what you think!

(2)

You rated this post out of 5. Change rating

2004-02-04

7,745 reads

Blogs

Five Ways Redshift Serverless Quietly Eats Your Budget

By

It is Friday, the queries are running, and nobody is watching the bill. That...

A Career of Memories

By

Annabel retired from Redgate Software this week. Across most of my career at Redgate,...

Rethinking Index Maintenance: Why avg_fragmentation_in_percent Is Outdated and What You Should Do Instead

By

As a SQL Server DBA with years of experience tuning production environments, I’ve seen...

Read the latest Blogs

Forums

What is the Cloud?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is the Cloud?

Changing the Schema

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Changing the Schema

Index Fragmentation Explained: Page Splits, Logical Reads, and What to Do

By Sanket Parmar

Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...

Visit the forum

Question of the Day

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
GO
I 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
GO
This worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3;
GO
What happens with this code?
SETUSER 'USER2'
GO
SELECT * FROM MySchema.MyTable
GO

See possible answers