When I use this syntax to create a new table (and primary key), the command works as it is supposed to:
The only problem is that the Primary Key gets named with a seemingly random set of characters at the end of the name, as in:
but if I omit the "PRIMARY KEY" clause from the CREATE statement and run this command:
the primary key is named as I wanted it ("PK_promotion").
Can I get the "PRIMARY KEY" clause to name the key from a string that I specify? Or am I going to have to CREATE the table first, then issue an ALTER command?
tia,
flynn
Code:
CREATE TABLE "DBO"."promotion"
(
"item_id" integer NOT NULL ,
"start_date" datetime NOT NULL ,
"end_date" datetime NOT NULL ,
"buy_quantity" integer NULL ,
"receive_quantity" integer NULL ,
"receive_item_id" integer NULL ,
"promo_id" varchar(17) ,
"description" text NULL ,
"customer_key" integer NULL ,
"parent_item_id" integer NULL ,
PRIMARY KEY ("item_id"),
)
The only problem is that the Primary Key gets named with a seemingly random set of characters at the end of the name, as in:
Code:
PK__promotion__78173351
but if I omit the "PRIMARY KEY" clause from the CREATE statement and run this command:
Code:
ALTER TABLE "promotion" ADD CONSTRAINT "PK_promotion" PRIMARY KEY ("item_id")
the primary key is named as I wanted it ("PK_promotion").
Can I get the "PRIMARY KEY" clause to name the key from a string that I specify? Or am I going to have to CREATE the table first, then issue an ALTER command?
tia,
flynn