Editorials

SQLServerCentral Editorial

Remembering Phil Factor

One of the most prolific and popular authors at Simple Talk has been Phil Factor. He wrote many pieces on all aspects of database work and has probably written more articles on the Redgate Product Learning site than anyone else. He has entertained, informed, and inspired many database professionals in his many years as an […]

5 (3)

You rated this post out of 5. Change rating

2025-09-19

68 reads

SQLServerCentral Editorial

Pushing the Limits of AGs

Many of you reading this likely have an Availability Group (AG) set up on at least one database in your organization. Maybe not most, but many of you as this has proven to be a technology that many people like for HA/DR, upgrades, and probably other uses. As the technology has evolved from it's SQL […]

5 (1)

You rated this post out of 5. Change rating

2025-09-17

84 reads

SQLServerCentral Editorial

The Yutes

I recently had the opportunity to talk a little PostgreSQL with the Salt Lake City PostgreSQL Meetup group (thank you for having me by the way). Great bunch of people who were really engaged and asked a lot of questions. On the way out of the event, I was chatting with one person (who had […]

5 (1)

You rated this post out of 5. Change rating

2025-09-13

190 reads

Blogs

The Book of Redgate: We Value Teams

By

This value is something that I still hear today: our best work is done...

Troubleshooting TempDB Log Full Errors When SSMS Won’t Connect

By

Have you ever received the dreaded error from SQL Server that the TempDB log...

Accelerating AI with Confidence: Why Microsoft Purview is Key to Responsible Innovation

By

Artificial intelligence is no longer a distant concept. It is here, embedded in the...

Read the latest Blogs

Forums

Bottlenecks on SQL Server performance

By runarlan

We have a BI-application that connects to input tables on a SQL Server 2022...

Is there some good routines for updating SQL Server database objects with GitHub

By Rod at work

At work we've been getting better at writing what's known as GitHub Actions (workflows,...

The Tightly Linked View

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Tightly Linked View

Visit the forum

Question of the Day

The Tightly Linked View

I try to run this code on SQL Server 2022. All the objects exist in the database.

CREATE OR ALTER VIEW OrderShipping
AS
SELECT cl.CityNameID,
       cl.CityName,
       o.OrderID,
       o.Customer,
       o.OrderDate,
       o.CustomerID,
       o.cityId
 FROM dbo.CityList AS cl
 INNER JOIN dbo.[Order] AS o ON o.cityId = cl.CityNameID
GO
CREATE OR ALTER FUNCTION GetShipCityForOrder
(
    @OrderID INT
)
RETURNS VARCHAR(50)
WITH SCHEMABINDING
AS
BEGIN
    DECLARE @city VARCHAR(50);
    SELECT @city = os.CityName
    FROM dbo.OrderShipping AS os
    WHERE os.OrderID = @OrderID;
    RETURN @city;
END;
go
What is the result?

See possible answers