Auto Increasing VARCHAR data type column in SQL SERVER 2005
-
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
-
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. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
I would use two fields, one strictly an autoincrementing number, the other (the composite field you want) fully calculated from the available data. :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.