2

Using Sql Server CE 4 I have created the follow table.

create table abc(id int identity(1,1) primary key)

If I try and insert a row to generate a new identity using the following:

insert into abc default values

I get an error stating there is an issue near the default word.

How can I do this using Sql Server CE 4 or is it not possible?

Schotime
  • 15,707
  • 10
  • 46
  • 75

2 Answers2

1
CREATE TABLE [abcd] (
  [id] int NOT NULL  IDENTITY (1,1) PRIMARY KEY
, [payload] bit NULL
);
GO
INSERT INTO abcd (payload) VALUES (0);
GO

Or assing the INT value yourself

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
0

Try this :

insert into abc (id) values (default)
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
JTorrecilla
  • 208
  • 1
  • 4