A Create/Declare Table statement with a Primary Key gives a false positive BP014 in Code Analysis
If you have a table declared like this:
Declare @Test table
(TheKey int Primary Key,
SomeData varchar(10) Not Null)
I am told that for "TheKey" "[NOT] NULL option is not specified in CREATE/DECLARE TABLE statement" defined. But, a Primary Key can never be null, so it is NOT NULL by nature.
So, when performing Code Analysis and the parser sees "Primary Key", "Not Null" should be inferred also.
2
votes
Jim
shared this idea
Hi,
I’m pleased to announce this issue was fixed in version 9.4.10 of SQL Prompt. You can access the latest version from https://www.red-gate.com/products/sql-development/sql-prompt/
Thank you for bringing it to our attention!
Kind Regards,
The Prompt Team