sqlI have a table in Microsoft SQL Server where insert or updates isn’t possible. Table is only responsible to increment a unique id.

The table looks like this:

CREATE TABLE [dbo].[CustomerOrderNumbers](
[customerOrderNumberId] [int] IDENTITY(1,1) NOT NULL,
[createdOn] [datetime] NOT NULL,
[isDeleted] [bit] NOT NULL,
PRIMARY KEY CLUSTERED
(
[customerOrderNumberId] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[CustomerOrderNumbers] ADD DEFAULT (getdate()) FOR [createdOn]
GO

ALTER TABLE [dbo].[CustomerOrderNumbers] ADD DEFAULT ((0)) FOR [isDeleted]

But how do you increase the primary key when you can’t insert any values?

Answer, insert default value:
INSERT INTO [CustomerOrderNumbers] DEFAULT VALUES

This command also works with Azure SQL database.

Cordova build APK – Package damaged

I tried to build an APK (Android) in Cordova, build is successful so far so good!
When transferring the file to my mobile I got error message during install “Installation is not possible, package is damaged”. I created a new Cordova project and compared my “config.xml” file with the one in the project that failed. Found out that the “android-versionCode” is causing the problem. This is specified in the top of the config.xml. Remove that and the install is successful!