I'm trying to add a column in a view that is not in a table then defaulting it to a value. I'm able to create the column however I am not seeing how to set the default value. COLL_STATUS is the column I added and I need to default it to 1. What I have so far --
CREATE VIEW [AQB_OB].[GISBURNSITES]
AS
SELECT [BurnSitesID] as BURNSITEID
,BS.[BurnProjectID] AS BURNPROJECTID
,(Select left(BUY.BurnYear, LEN(BUY.BurnYear)-5)) As CURRENTYEAR
,[BurnerID] AS BURNERID
,[FirstName] AS FIRSTNAME
,[MiddleName] AS MIDDLENAME
,[LastName] AS LASTNAME
,[Organization] AS ORGANIZATION
,[Contact] AS PRIMARYCONTACT
,[Email] AS EMAIL
,'COLL_STATUS' as COLL_STATUS
FROM [AQB_MON].[AQB_OB].[BurnSites] BS
inner join [AQB_MON].[AQB_OB].[BurnProject] BP on BS.[BurnProjectID] = BP.BurnProjectID
question from:
https://stackoverflow.com/questions/66065972/set-default-value-in-a-sql-view 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…