When I execute the following proc, I get this warning:
Attempting to set a non-NULL-able column's value to NULL.
USE [DbTwo]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter proc [dbo].[TEST_warning_proc]
as
IF OBJECT_ID('MySchema..vitals', 'U') IS NOT NULL DROP TABLE MySchema..vitals
IF OBJECT_ID('MySchema..order_list', 'U') IS NOT NULL DROP TABLE MySchema..order_list
select * into MySchema..vitals
from DbOne..vitals
where FacilityID in
(select FacilityID from DbTwo..MySchemaFacilities)
select * into MySchema..order_list
from DbOne..order_list
where FacilityID in
(select FacilityID from DbTwo..MySchemaFacilities)
How can this be possible since I'm doing a SELECT * INTO? Shouldn't that create a new table that exactly mirrors the original table?
I tried setting:
SET ANSI_WARNINGS OFF
but that didn't help.