问题描述
我有一个包含很多列和行的表 (myData),并有另一个表 (myFileNo) 单值,这意味着单行、单列、单单元格 (FileNo),
I have a table (myData) with lots of columns and rows, and have another table (myFileNo) single value which means single row, single column, single cell (FileNo),
我写了一个 sql 查询,它通过检查 myFileNo 更新 myData,并在进程结束后更改 FileNo 的值.
I wrote an sql query which updates myData by checking myFileNo, and after process ends it changes the value of FileNo.
将单值数据保存在表中对我来说没有多大意义,这是正确的做法吗?
It does not make much sense to me to keep the single value data in a table, is this the proper way to do it ?
FileNo 的目的
它充当标识号,但不像主键那样创建.一个例子(之前和之后):
It acts as an identification number, but not created like a primary key. An example (before, and after):
之前
myData, FileNo
A, NULL
A, NULL
B, NULL
C, NULL
A, NULL
D, NULL
D, NULL
文件编号:15
之后
myData, FileNo
A, 16
A, 16
B, 17
C, 18
A, 16
D, 19
D, 19
FileNo: 19
推荐答案
如果 fileNo 被多个表和进程引用,然后将其存储在一个表中就可以了,您可以调查扩展属性,但我会保留放在桌子上.
In the case that the fileNo is being referenced by multiple tables and processes then storing it in a table is fine, you could investigate extended properties, but I would keep it in a table.
如果你只需要这个表并且你只需要能够识别下一次加载的最大值+1,我建议你在插入之前检查Max(FileNo),前提是这不会导致性能问题,基于表的大小.
If you only need it for this table and you only need to be able to identify the maximum value + 1 for the next load, I suggest you just check Max(FileNo) before inserting, providing this does not cause performance issues, based on the size of the table.
这篇关于在sql server中保留单个数据的正确方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)