Skip to content
Advertisement

Tag: tsql

Create a combined primary key with a one column accepting NULL

I have a table CustomerLocation with the following columns : Country Region City I want to create a composite primary key with the 3 columns mentioned above knowing that the Region column is NULLABLE. Answer You can’t. The definition of primary key specifies that only non-NULL values are allowed. This is clearly explained in the documentation: All columns defined within

Import JSON File into SQL Server Table with nested Arrays

I’m trying to import the Census Block GeoJSON file and unable to get “Coordinates” for each block along with it’s properties. I’m trying to get the ID, BlockGrp, Block.. and it’s associated coordinates. Below is my code, but I’m unable to get the coordinates since it’s in an array. Can anybody guide me on how to make it work? The

Advertisement