As per the comments, I'm going to assume you're getting mixed up between update and insert.
USE [DB_A] ;
UPDATE dbo.address
SET City = 'test',
State = 'ing'
WHERE City IS NULL ;
And
USE [DB_A] ;
UPDATE dbo.address
SET City = NULL,
State = NULL
WHERE City = 'test' ;
I think you're there otherwise :-)
Answer from kezsto on Stack ExchangeVideos
When you use a column with NOT NULL then it's not possible to add NULL to the column.
I guess you have other columns as well, like:
Create TABLE Products
(
[ProdID] [int] IDENTITY(1,1) NOT NULL,
[Col2] int NULL,
[Col3] int NOT NULL,
[Col4] int NULL
)
When you want to insert a record to this table dont mention the [ProdID] column, it will be filled automaticly because its a identity.
Example:
INSERT INTO Products ([Col2],[Col3],[Col4]) VALUES (1,2,NULL)
Looks like column mapping issue in your ssis package.
It might have mapped to the column from other table or select which has null values and also check identity insert enabled or not.
Hello everyone, I just can't figure out the, as I guess, very easy solution to my problem. (the worst part is, I didn't find anything good / related via google for example).
I want to insert data into a table2, IF, ond only IF a specific Value from #table 1 is NOT NULL. If this Value is NULL, I don't want to insert anything at all.
Like:
CASE #table1.value is not null THEN
Insert into table2 (values) select * from table1
ELSE 'do nothing'
END
But it is not working. can anybody point my into the right direction please ? :)