In SQL Management Studio for a local database you can pressCTRL+0
to set a cell value to null
With SQL Azure this doesn't work with the following error message:
I submitted a bug here: https://feedback.azure.com/forums/908035-sql-server/suggestions/35683135-add-ctrl-0-back-for-sql-azure-in-smss
As no one is voting this up I have the feeling there is another way to set the value to null, and I'm just using some legacy path no one cares about.
To be clear:
- I strongly prefer to not write every time a SQL statement, because there will be a time that I forget to write the
where
clause before running it, corrupting all my data. - I also don't like to write a CMS everytime I have to set something to null.
Any workarounds for setting an individual cell to null?
For people not believing me:
CREATE TABLE [dbo].[NewsSource](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](120) NOT NULL,
[Thumbnail] [nvarchar](150) NULL,
[RssFormatId] [int] NULL,
[Active] [bit] NOT NULL,
[Interval] [int] NULL,
[LastStarted] [datetime2](7) NOT NULL,
[LastSuccess] [datetime2](7) NOT NULL,
[TopicId] [int] NULL,
CONSTRAINT [PK_NewsSource] PRIMARY KEY CLUSTERED
As for some reason I'm not being believed. To be clear: for me it's very easily reproducable.
- Create any table with a nullable column on SQL Azure.
- Set the column to any value.
- Use SMSS to try to set the value of this column to null through CTRL+0
- 100% of the times I'm getting the error message attached.
If this is really rare it could mean I have somehow a corrupted SMSS.
Version numbers
- Microsoft SQL Azure (RTM) - 12.0.2000.8 May 2 2019 20:11:13 Copyright (C) 2019 Microsoft Corporation
- SQL Server Management Studio 15.0.18040.0
- Microsoft Analysis Services Client Tools 15.0.900.156
- Microsoft Data Access Components (MDAC) 10.0.17763.1
- Microsoft MSXML 3.0 6.0
- Microsoft Internet Explorer 9.11.17763.0
- Microsoft .NET Framework 4.0.30319.42000
- Operating System 6.3.17763
To show that the normal manual Update statement succeeds:
UPDATE NewsSource
SET Thumbnail = null
WHERE Id = 17
UPDATE
As some people mention they don't have this problem. I have tried reinstalling all elements from SQL Management Studio and SQL Server and I still have this issue.