Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Spending Time in the Office

I've visited a few customers in the last few years that require most people to work in the office. Recently I had the chance to go to Epic Systems, just outside Madison, WI, USA. They are a medical records software provider that was very reminiscent of Microsoft in some ways, and quite different in others. I published a blog with some pictures, so you can see how cool an office this is.

Epic has all their employees coming into the main office every day. They are flexible if you have needs, but the expectation is that employees go in every day. I believe this is also their policy, and culture, in various offices around the world.

This is somewhat rare these days, but not unique. I've worked with one other (10,000 people) large company and a few small ones that have similar policies and expectations. Their offices aren't as fun, but they are still neat. I love working at home, but I miss the camaraderie of being in an office. JD Edwards was probably my favorite place to work, and I enjoyed going into the office with friends, having lunch, going to movies together, and especially our Friday afternoon Nerf battles.

I'm lucky in that I get to split my time. I'm at home much of the time, but I do go to the Redgate offices 4-5 weeks a year. Usually, I visit Cambridge, but I have visited the offices in Austin, Pasadena, Brisbane, and Amsterdam. I've yet to get to the Berlin office, but I'm hoping to fix that later this year or next.

I know many tech professionals, and even those in other areas, prefer to work at home and can do their jobs effectively. We saw this during the pandemic, but I also think that many of us are missing something by not being the same room with others. I find I build better bonds, better understand the way others communicate, and we can go back and forth with brainstorming, debate, discussions, and other collaborative actions more effectively. This can work remotely, but for many organizations that didn't start this way, I feel like something is missing.

I don't want to give up my ability to work at home, but I'd also hate to never visit an office either. I think I have a great balance, I enjoy both environments, and I appreciate the ability to change my location on a regular basis.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
Stairway icons Database Deployments

Concurrency and Baseline Control: Level 5 of the Stairway to Reliable Database Deployments

Massimo Preitano from SQLServerCentral

As database development scales across multiple contributors, concurrency becomes an inherent aspect of the process. Changes that are individually correct may still conflict when developed against a shifting baseline. This level introduces a disciplined approach to managing parallel changesets by controlling their scope, identifying overlap, and resolving conflicts through realignment. By ensuring that only one changeset retains its original baseline while others are adapted accordingly, deployments remain predictable and consistent. Once released, changesets are treated as immutable, and further evolution proceeds through new, forward-only changes.

Technical Article

How to host an AI text embeddings model for SQL Server using Ollama

Additional Articles from SQLServerCentral

When we want to use AI-based comparisons of text, via vector search in SQL Server, we need to first generate embeddings for the text. An embedding is a numeric representation of meaning, usually represented by vectors. In this article, I’ll show you how to use Ollama to host a server locally that can be used to generate embeddings.

Blog Post

From the SQL Server Central Blogs - Creating a SQL Stored Procedure to Load a SCD2

DataOnWheels from DataOnWheels

This is a blog that I am writing for future me and hopefully it’ll help a few of you save some time too! It’s not often that I get...

Blog Post

From the SQL Server Central Blogs - My Toolbox - AI

Zikato from StraightforwardSQL

I trusted AI to redesign this entire blog. The layout, the CSS, the deployment pipeline, the shortcodes. I use it to build home automation, organize my notes, fix my...

SQL Server 2022 Query Performance Tuning

Grant Fritchey from SQLServerCentral

Troubleshoot slow-performing queries and make them run faster. Database administrators and SQL developers are constantly under pressure to provide more speed. This new edition has been redesigned and rewritten from scratch based on the last 15 years of learning, knowledge, and experience accumulated by the author. The book Includes expanded information on using extended events, automatic execution plan correction, and other advanced features now available in SQL Server.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Multiple Values Inserted

I have this code on SQL Server 2022. What happens when it runs all at once?
DROP TABLE IF EXISTS dbo.Commission
GO
CREATE TABLE dbo.Commission
(id INT NOT NULL IDENTITY(1,1) CONSTRAINT CommissionPK PRIMARY KEY
, salesperson VARCHAR(20)
, commission VARCHAR(20)
)
GO
INSERT dbo.Commission
( salesperson, commission)
VALUES
( 'Brian', 12 ),
( 'Brian', 'None' )
GO
 

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

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

Answer: I get a SELECT permission denied error.

Explanation: Moving the schema to a new owner invalidates permissions. All permissions are dropped. Ref: ALTER AUTHORIZATION - https://learn.microsoft.com/en-us/sql/t-sql/statements/alter-authorization-transact-sql?view=sql-server-ver17

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2019 - Development
identity increments by 10,000 when it was supposed to be 1 - hi a peer of mine who ive never known to be wrong says a new table he created with pk identity(1,1) jumped by 10000 on one insert.   has anyone ever seen this anomaly?
Editorials
What is the Cloud? - Comments posted to this topic are about the item What is the Cloud?
Midjourney, Healthcare? - Comments posted to this topic are about the item Midjourney, Healthcare?
Changes, Happiness, and a Few Tears - Comments posted to this topic are about the item Changes, Happiness, and a Few Tears
Follow Your Hunch - Comments posted to this topic are about the item Follow Your Hunch
The Slow Growing Problems - Comments posted to this topic are about the item The Slow Growing Problems
Article Discussions by Author
Extreme DAX: Take your Power BI and Fabric analytics skills to the next level - Comments posted to this topic are about the item Extreme DAX: Take your Power BI and Fabric analytics skills to the next level
Changing the Schema - Comments posted to this topic are about the item Changing the Schema
Index Fragmentation Explained: Page Splits, Logical Reads, and What to Do - Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits, Logical Reads, and What to Do
BCP on Linux - Comments posted to this topic are about the item BCP on Linux
You Probably Don't Need a Vector Database - Comments posted to this topic are about the item You Probably Don't Need a Vector Database
What Happens When You Ask a Local AI to Query Your Database? - Comments posted to this topic are about the item What Happens When You Ask a Local AI to Query Your Database?
Detecting Characters - Comments posted to this topic are about the item Detecting Characters
Displaying Money - Comments posted to this topic are about the item Displaying Money
SQL Server 2022 - Development
Increment a number in a SQL Query based on a value - I have an issue where I have a Bill of Material list of items where some of the item numbers are blank. I need to give them sequential numbers from a beginning number like 9000000. then the next blank would be 9000001 and so on. I thought I could create a table and store the […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -