数据表 vote_user 如下
其中tid为外键,数据表vote_user_type已经存在并有3行数据
CREATE TABLE vote_user (
uid int IDENTITY (1, 1) NOT NULL,
tid int NOT NULL,
uname varchar(20) NOT NULL,
ucardno varchar(18) NOT NULL,
ugender char(2) NOT NULL,
uparty varchar(10) NULL,
uifvote int NULL,
uifreg int NULL,
PRIMARY KEY (uid ASC),
FOREIGN KEY (tid)
REFERENCES vote_user_type(tid)
ON DELETE NO ACTION
ON UPDATE CASCADE
)
存储过程脚本如下:
CREATE PROCEDURE vote_pcd_add