When we use select into and create a table, how to control null-ability?
By default it is driven by source table from which we are selecting.
But what about if we want to change the null-ability from source to target. Say we have few columns, which are not-null (required) on source side, but we need them null allowed on target side, then:
use any expression that uses a built-in function like SUBSTRING, LEFT, RIGHT etc (except ISNULL)
select col1, col2 into TargetTable from openquery (LinkedServerName, ‘select to_char(col1) as col1, to_char(col2) as col2 from SourceTable’)