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. Database & SysAdmin
  3. Database
  4. question on sql server 2005

question on sql server 2005

Scheduled Pinned Locked Moved Database
questiondatabasesql-serversysadmin
4 Posts 4 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.
  • P Offline
    P Offline
    pratima1
    wrote on last edited by
    #1

    hi, i have created a table named CompanyDetails.in this table Company name is one column,and CompanyID is another column,i want when i will enter the company name company id will autogenerated like RXY12365,how i will do it? if i will make companyID as identy column it will generate only int values like 1,2.

    p.sethi

    M Y K 3 Replies Last reply
    0
    • P pratima1

      hi, i have created a table named CompanyDetails.in this table Company name is one column,and CompanyID is another column,i want when i will enter the company name company id will autogenerated like RXY12365,how i will do it? if i will make companyID as identy column it will generate only int values like 1,2.

      p.sethi

      M Offline
      M Offline
      Marek Grzenkowicz
      wrote on last edited by
      #2

      Please explain this further - RXY12365. Do you need an ID that consists of 3 capital letters and then 5 integers? Should it be random? Why do you need something like this?

      1 Reply Last reply
      0
      • P pratima1

        hi, i have created a table named CompanyDetails.in this table Company name is one column,and CompanyID is another column,i want when i will enter the company name company id will autogenerated like RXY12365,how i will do it? if i will make companyID as identy column it will generate only int values like 1,2.

        p.sethi

        Y Offline
        Y Offline
        Yulianto
        wrote on last edited by
        #3

        Using trigger in stored procedure. When insert occurred, edit the companyID.


        Work hard, Work effectively.
        Own business (desain web) ,Stock Pick Guide.

        1 Reply Last reply
        0
        • P pratima1

          hi, i have created a table named CompanyDetails.in this table Company name is one column,and CompanyID is another column,i want when i will enter the company name company id will autogenerated like RXY12365,how i will do it? if i will make companyID as identy column it will generate only int values like 1,2.

          p.sethi

          K Offline
          K Offline
          Keshav V Kamat 0
          wrote on last edited by
          #4

          Hi Use a trigger, so that the values in the company id are autoincremented/updated/kept same, according to the changes made in the company name.

          Keshav Kamat :) India

          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