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
Personally, for the best control, you should create your table first. For example:
Create Table #MyTable (
SerialNumber int Not Null, -- or however this is correctly defined.
Action int Null
)
Then, do a Insert Into ... Select From ...
Insert Into #MyTable(SerialNumber, Action)
Select SerialNumber, 0
From FSE_SerialNumber
Then, there will be no question of what the fields should be.
I know this isn't quite what you asked, but it might be something to consider.