Damian is Microsoft MVP and Certified Trainer with 20 years of experience. Now trying to share the passion and knowledge among others. He runs the blog with his daughter as she is really passionate about technology

Person Stirring Coffee with a Spoon

Weekly reading #21

Hello, hello! We have just started new week! We missed the weekly reading last time due to travelling across the Europe over the weekend. There is however a lot...

2019-07-15

32 reads

Weekly reading #20

Being MVP for the #11 straight year is something unique! Thank you! The first week of July has just started. So oficially we have started vacations and the team...

2019-07-01

13 reads

Coffee

Weekly reading #19

Good afternoon folks! It is Monday Tuesday already after a long weekend in Poland. I do not know what temperature you have but here we are like in a...

2019-06-25

14 reads

Breakfast by the sea image

Weekly reading #18

Ready for vacations? The CodingFamily team is almost ready – we have some vacations plans including great conferences during summer and in the autumn. T-SQL bugs, pitfalls, and best...

2019-06-17

14 reads

Round Table of Coffee

Weekly reading #0x10

This is the blog anniversary! 16th Weekly reading has come into the light! For great articles and a video wait for you! Report Parameter Support for Paginated Report E-Mail...

2019-06-03

15 reads

Cup and Saucer

Weekly reading #15

SQLDay 2019 is gone. The Data Community.PL has now a new goal – it is the SQL Saturday #914 in Torun. The speakers will be announced after July 30th....

2019-05-27

19 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

Planning for tomorrow, today - database migrations

By John Martin

Comments posted to this topic are about the item Planning for tomorrow, today -...

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,...

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