我需要一个永远不会重复的数字。 [英] I need a number that can never be duplicated.

查看:110
本文介绍了我需要一个永远不会重复的数字。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这将是自动分配的客户编号。我想

它要快(所以它不必在

sql server中检查存在)并且不可能重新安装。可能是

日期/小时/分钟/秒全部是一个整数吗?

谢谢,

Trint


.Net程序员
tr********@hotmail.com


***通过开发人员指南 http:// www。 developersdex.com ***

不要只是参加USENET ......获得奖励!

This will be a customer number that is automatically assigned. I want
it to be fast (so that it doesn''t have to be checked for existance in
sql server) and impossible to ever reoccure. Could it be
date/hour/minute/second all as one integer?
Thanks,
Trint

.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!

推荐答案

您将在哪里存储此号码和其他客户信息?您是否会使用该号码进行验证或插入详细信息

记录?


为什么不将MSSQL生成ID时将客户数据插入到数据库?


-

Al Reid


它不是你不喜欢的知道这让你陷入困境。这就是你所知道的

肯定只是不是这样。 ---马克吐温


" Trint Smith" < TR ******** @ hotmail.com>在消息新闻中写道:ub ************** @ TK2MSFTNGP12.phx.gbl ...
Where will you store this number and the other customer info? Will you ever use that number for validation or inserting detail
records??

Why not just let MSSQL generate the ID when you insert the customer data into the database?

--
Al Reid

"It ain''t what you don''t know that gets you into trouble. It''s what you know
for sure that just ain''t so." --- Mark Twain

"Trint Smith" <tr********@hotmail.com> wrote in message news:ub**************@TK2MSFTNGP12.phx.gbl...
这将是一个自动分配的客户编号。我希望它快速(这样就不必在sql server中检查它是否存在)并且不可能重新安装。可能是
日期/小时/分钟/秒都是一个整数吗?
谢谢,
Trint

网络程序员
tr ******** @ hotmail.com

***通过Developersdex http://www.developersdex.com ***
不要只参加USENET ......获得奖励!
This will be a customer number that is automatically assigned. I want
it to be fast (so that it doesn''t have to be checked for existance in
sql server) and impossible to ever reoccure. Could it be
date/hour/minute/second all as one integer?
Thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!



您好Trint,


为什么不,请查看Now.ticks for that


并且不要忘记首先从你开始的点开始减去刻度

你的系统直到0001(当然是固定价值)。


我希望你在哪里寻找?


Cor
Hi Trint,

Why not, have a look for Now.ticks for that

And do not forget to substract the ticks first from the point you did start
with your system till 0001 (is of course a fixed value).

I hope that was where you where looking for?

Cor
这将是自动分配的客户编号。我希望它快速(这样就不必在sql server中检查它是否存在)并且不可能重新安装。可能是
日期/小时/分钟/秒都是一个整数吗?
This will be a customer number that is automatically assigned. I want
it to be fast (so that it doesn''t have to be checked for existance in
sql server) and impossible to ever reoccure. Could it be
date/hour/minute/second all as one integer?



* Trint Smith< tr ****** **@hotmail.com> scripsit:
* Trint Smith <tr********@hotmail.com> scripsit:
这将是自动分配的客户编号。我希望它快速(这样就不必在sql server中检查它是否存在)并且不可能重新安装。它可以是
日期/小时/分钟/秒作为一个整数吗?
This will be a customer number that is automatically assigned. I want
it to be fast (so that it doesn''t have to be checked for existance in
sql server) and impossible to ever reoccure. Could it be
date/hour/minute/second all as one integer?




您可以使用GUID(''System.Guid'')。


;-)

-

Herfried K. Wagner [MVP]

< http://www.mvps.org/dotnet>



You can use a GUID (''System.Guid'').

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


这篇关于我需要一个永远不会重复的数字。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆