SQL SERVER 2005中的自动增加VARCHAR数据类型列 [英] Auto Increasing VARCHAR data type column in SQL SERVER 2005

查看:79
本文介绍了SQL SERVER 2005中的自动增加VARCHAR数据类型列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想创建一个列,该列在插入其他列的数据时会自动增加.基于某些条件,此列的数据类型为varchar,格式如下:
BD/00001/99A
EX/00002/00B
PS/00003/00A
之间的数字每次插入新数据时,00001-00003将递增.其他帮助是基于条件的,通常不会改变.
任何帮助将不胜感激.

hi there,
i want to create a column that increments automatically when data for other columns are inserted. The data type for this column is varchar made of the following format based on some conditons
BD/00001/99A
EX/00002/00B
PS/00003/00A

the numbers between 00001-00003 will be incrementing each time a new data is inserted. others are conditions based, usually not changing.
any help would be appreciated

推荐答案

我将使用两个字段,一个严格地是自动递增的数字,另一个是(

:)

I would use two fields, one strictly an autoincrementing number, the other (the composite field you want) fully calculated from the available data.

:)


这篇关于SQL SERVER 2005中的自动增加VARCHAR数据类型列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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