If we want to make some identiity value in sqlserver , we can use identity data type in a table.
However, there are some disadvantages on that style,
But , how to ?
Here we go

we can use

replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')

to get time as char

result is: 20170210000222

And we can use replace(CONVERT(uniqueidentifier,NewID(), 120 ),'-','')

to gert random number conver to char

How about to make they together

select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','') + replace(CONVERT(uniqueidentifier,NewID(), 120 ),'-','')

That result like 20170210000436590385B62DDD4D4B9ABB8009BDEDDD40

Then you can make it The result is unqiue and easy to management it.

sqlserver datatime value plus random number的更多相关文章

  1. Random number

    Original #include <stdlib.h> #include <time.h> srand(time(NULL)); rand(); The versions o ...

  2. How to generate a random number in R

    Generate a random number between 5.0 and 7.5x1 <- runif(1, 5.0, 7.5) # 参数1表示产生一个随机数x2 <- runif ...

  3. Linux shell get random number

    the Shell Profile: When a new interactive shell is started, /etc/profile, followed by /etc/bash.bash ...

  4. Case Study: Random Number Generation(翻译教材)

    很荣幸,经过三天的努力.终于把自己翻译的教材做完了,现在把它贴出来,希望能指出其中的不足.   Case Study: Random Number Generation Fig. 6.7  C++ 标 ...

  5. C# random(number)

    C#随机函数Random()的用法 出自:http://www.cnblogs.com/wang726zq/archive/2012/04/28/2474711.html http://blog.cs ...

  6. ISO C Random Number Functions

    This section describes the random number functions that are part of the ISO C standard. To use these ...

  7. LoadRunner压力测试之Unique Number参数类型、Random Number参数类型浅析

    前几天工作需要用LoadRunner进行压力测试,期间对手机号进行参数化设置. 当时选用了<Value>137{Random_quhao}{Unique_weiyi}</Value& ...

  8. 文献翻译|Design of True Random Number Generator Based on Multi-stage Feedback Ring Oscillator(基于多级反馈环形振荡器的真随机数发生器设计)

    基于多级反馈环形振荡器的真随机数发生器设计 摘要 真随机数生成器(trng)在加密系统中起着重要的作用.本文提出了一种在现场可编程门阵列(FPGA)上生成真随机数的新方法,该方法以 多级反馈环形振荡器 ...

  9. Python(正则 Time datatime os sys random json pickle模块)

    正则表达式: import re #导入模块名 p = re.compile(-]代表匹配0至9的任意一个数字, 所以这里的意思是对传进来的字符串进行匹配,如果这个字符串的开头第一个字符是数字,就代表 ...

随机推荐

  1. C# 把文件夹下所有文件添加到集合中

    private List<string> FindFile(string Path) { List<string> list=new List<string>(); ...

  2. L1-006 连续因子 (20分)

    题意分析 题目中已经将意思说的很清楚了,就是输出一个数的最长连续因子的个数,并且输出是哪几个因子相乘.可以将题目从这两个角度进行分析: N为素数时,最长连续因子的个数为1,即它自己. N不为素数时,即 ...

  3. 字符串转hash进阶版

    #include<bits/stdc++.h> using namespace std; ,mod=; vector<unsigned> H[mod]; void Add(un ...

  4. postman的测试,用对象接收所有的字符串

    1.post请求 Headers: Content-Type  application/json { "taskId":"1000001161", " ...

  5. Python解析json字符串,json字符串用法

    json数据简介 json数据是一个轻量级的数据交换格式,采用完全独立于语言的文本格式,这些特性使json称为理想的数据交换语言,易于人阅读和编写,同时易于机器解析和生成. json中的字符集必须是U ...

  6. Git基础知识 —— 获取Git仓库

    前言 官方提供了两种获取Git仓库的方法,第一种是在本地现有项目目录下导入所有文件到Git中,第二种就是从Git仓库中clone项目到本地 这里就不说Git的安装了哈,有需要的小伙伴可以查看该博文:h ...

  7. python 快速创建字典 fromkes()

    作用:快速创建字典 特点:共用value seq = ['google', 'ie', 'firefox'] # seq为可迭代对象(str, list, tuple, dict, set) dic ...

  8. [mvc>actionResult] 封装一个操作方法的结果并用于代表该操作方法执行框架级操作

  9. MYGUI3.2改造——完善windows下的文字显示

    MYGUI 3.2 是支持中文显示的——往“MyGUI_Fonts.xml”文件里添加上中文的编码范围即可,这个网上有很多. 能显示中文后,再添加中文的自动换行,这个网上有:http://blog.s ...

  10. 数据结构与算法 --- js描述集合

    js描述集合 function Set(){ this.datasource=[]; this.add=add; this.remove=remove; //this.size=size; //thi ...