How to control nullability in SELECT INTO for literal-based columns

前端 未结 3 773
旧时难觅i
旧时难觅i 2021-01-11 16:57

I am noticing that when I use this statement, the Action column is not nullable:

SELECT TOP 0 SerialNumber, 0 [Action] INTO #MyTable FROM FSE_Se         


        
3条回答
  •  情歌与酒
    2021-01-11 16:59

    Quick general hint for SELECT ... INTO : use ISNULL( with a column and it will be created as a NOT NULL column in the table.

提交回复
热议问题