自动生成RefNo [英] Auto generation of RefNo
问题描述
大家好..我有一个问题
我有两个表BrokSchmMaster,BrokSchmDetails
表BrokSchmMaster列
BrokSchmName SegID BrokSchmType Scrip RefID
Schm 1 2 0 1
表BrokSchmDetails列
RefID BrokSettlmentType Onvalue FromValue ToValue
1 2 1 0.01 100
1 2 1 100.01 500
1 2 1 500.01 1000
1 2 1 1000.01 9999999.99
.....在BrokSchmDetails中有几条记录,对于BrokSchmMaster中的一条记录...我希望RefID在第一张表(BrokSchmMaster)的第二张表中自动生成RefID
Hi everyone..I have an issue
I have two tables BrokSchmMaster,BrokSchmDetails
Table BrokSchmMaster Columns
BrokSchmName SegID BrokSchmType Scrip RefID
Schm 1 2 0 1
Table BrokSchmDetails Columns
RefID BrokSettlmentType Onvalue FromValue ToValue
1 2 1 0.01 100
1 2 1 100.01 500
1 2 1 500.01 1000
1 2 1 1000.01 9999999.99
.....There are several records in BrokSchmDetails for a single record in BrokSchmMaster ... I want RefID to be automatically generated in Second table from first table (BrokSchmMaster) RefID
推荐答案
如果您编写了存储过程 [ ^ ].
但是在开始阅读以上文章之前,请先阅读以下内容:
身份 [主键 [ ^ ]
外键 [ ^ ]
关系数据库 [
You can "automatically" add RefNo in second table from first table, if you write a stored procedure[^].
But before you start reading above article, please, read more about:
identity[^]
primary key[^]
foreign key[^]
Relational database[^]
这篇关于自动生成RefNo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!