question

sharon avatar image
sharon asked

Anyidea about this data type

Does anyone know what this data type is; Below is the table definition. It is running on SQL server 2017 with dbo.ident, dbo.zint datatype that I have never seen. Please advise. Thank you!

CREATE TABLE [dbo].[table](

[tableid] [dbo].[ident] NOT NULL,

[description] [dbo].[shortdesctype] NOT NULL,

[source] [dbo].[ident] NOT NULL,

[countper1000] [dbo].[zint] NOT NULL,

[bestpractice] [char](30) NOT NULL,

[createid] [dbo].[udtuserid] NOT NULL,

[createdate] [dbo].[createdatetype] NOT NULL,

[updateid] [dbo].[udtuserid] NOT NULL,

[lastupdate] [dbo].[lastupdatetype] NOT NULL,

CONSTRAINT [PKtableid] PRIMARY KEY CLUSTERED

(

[tableid] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [primary]

) ON [primary]

GO

datatype
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
anthony.green avatar image
anthony.green answered

They will be user defined data types.

Take a look at the programmability folder and you should see the data types and what they refer to.


e.g


Create type email from nvarchar(256) not null


will create a type called email which is a not null nvarchar(256)


create table emails(

emailaddress dbo.email

)

https://docs.microsoft.com/en-us/sql/relational-databases/databases/create-a-user-defined-data-type-alias?view=sql-server-ver15

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

MikeyBronowski avatar image MikeyBronowski commented ·

I will add that with queries like that you can find out the details of the user type.


select u.name userType, s.name sysType, *
from sys.types u 
join sys.types s on u.system_type_id = s.user_type_id
where u.is_user_defined = 1;
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.