I’m reading an excellent article by Paul White – Dynamic Seeks and Hidden Implicit Conversions! and he uses this code:
DECLARE @Like dbo.Name = N'D%'
I’m trying to find out more about using dbo.Name to declare a variable, not having much luck with books online. Any ideas where I can find this?
Thanks
dbo.Nameis a User Defined Type. It’s a way of introducing a synonym for another type.The feature is not widely used (in my experience) – the standard SQL version would be
CREATE DOMAIN, but that includes support for arbitrary constraints (see e.g. the PostgreSQL documentation for CREATE DOMAIN), whereasCREATE TYPEin SQL offers very little over just introducing the synonym.