Skip to content
Advertisement

Database Data Type

I need to develop API from the database which already exists.I have got notice some of the IDs have a “Code” key word before the data type ( mostly “char”). Could you please help me to understand what “code” is doing? I searched for converting or casting but I could not find any ideas. this is the element

Advertisement

Answer

Code(char(5)) means that there is some user-defined type in the database, declared like

CREATE TYPE Code 
FROM char(5) NOT NULL ;  

Then you have table like

CREATE TABLE Foo (AdminAccountID Code, ...)

In C# code you can use string for it

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement