Home > database >  Want to know how to solve this problem
Want to know how to solve this problem

Time:09-19

Small white one, why want to ask the bosses statements can be used alone, yes, but one with a decimal this type will be an error, want to know why and how to write code can run normally

CodePudding user response:

Computed columns do not need to specify the data type

CodePudding user response:

reference 1st floor RINK_1 response:
computed columns do not need to specify the data type
but this job must use the data type, no problem, I don't know this data type code would like to know how to solve

CodePudding user response:

refer to the second floor qq_46250934 response:
Quote: refer to 1st floor RINK_1 response:
computed columns do not need to specify the data type
but this job must use the data type, I don't know this data type code no problem, want to know how to solve the


Computed columns default inheritance of computed columns of data field type, like this, you calculated columns default is a DECIMAL type,

CodePudding user response:

# 1 is right, don't need,
If you must, you can turn strong:
 USE tempdb for 
GO
IF OBJECT_ID (' t ') IS NOT NULL
DROP TABLE t
GO
CREATE TABLE (t
Base a DECIMAL (10, 2),
Bonus DECIMAL (10, 2),
To a DECIMAL (10, 2),
Yfgz AS base + bonus + practice,
Y2 the AS CAST (base + bonus + the practice AS a DECIMAL (10, 2))
)
GO


CodePudding user response:

Really want to put the gypsy song out of your Ctrl C V to my mind!
  • Related