ColumName DataType Not Straightly Mentioned in the Table.
Some times we can create table without mentioning column data type straightly.
For eg:
o
CREATE TABLE [dbo].[Customer]
(
[CustomerID] [int] NOT NULL IDENTITY(1, 1),
[CustomerName] [varchar] (50) NOT NULL,
[CreditLine] [smallmoney] NULL,
[OutStandingBalance] [smallmoney] NULL,
[AvailableCredit] AS ([CreditLine]-[OutStandingBalance]),
[CreationDate] [datetime] NOT NULL
) ON [PRIMARY]
Here if we observe AvailableCredit datatype is not mentioned. But in the alias the result it takes as smallmoney.
For eg:
o
CREATE TABLE [dbo].[Customer]
(
[CustomerID] [int] NOT NULL IDENTITY(1, 1),
[CustomerName] [varchar] (50) NOT NULL,
[CreditLine] [smallmoney] NULL,
[OutStandingBalance] [smallmoney] NULL,
[AvailableCredit] AS ([CreditLine]-[OutStandingBalance]),
[CreationDate] [datetime] NOT NULL
) ON [PRIMARY]
Here if we observe AvailableCredit datatype is not mentioned. But in the alias the result it takes as smallmoney.
Comments