Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Auto Increasing VARCHAR data type column in SQL SERVER 2005

Auto Increasing VARCHAR data type column in SQL SERVER 2005

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dambod
    wrote on last edited by
    #1

    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

    L 1 Reply Last reply
    0
    • D Dambod

      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

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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.


      D 1 Reply Last reply
      0
      • L Luc Pattyn

        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.


        D Offline
        D Offline
        Dambod
        wrote on last edited by
        #3

        u mean using stored proc (somevariable + autonumber) as Columnname, can u give me some hint, if u have thank u in advance.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups