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. using @@IDENTITY (or nething like this)for char datatype(sql server)

using @@IDENTITY (or nething like this)for char datatype(sql server)

Scheduled Pinned Locked Moved Database
databasesql-serversysadmin
4 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.
  • U Offline
    U Offline
    utsav_verma
    wrote on last edited by
    #1

    Hi guys i m having a table which primary key is char(7). i want to have last inserted row's id value but @@IDENTITY returns numeric rather character. I dnt hv ne field like time timestamp too :( Thanks in advance Utsav

    U 2 Replies Last reply
    0
    • U utsav_verma

      Hi guys i m having a table which primary key is char(7). i want to have last inserted row's id value but @@IDENTITY returns numeric rather character. I dnt hv ne field like time timestamp too :( Thanks in advance Utsav

      U Offline
      U Offline
      utsav_verma
      wrote on last edited by
      #2

      do i need 2 mention thaT CHAR primery key is not identity (i.e. autoincrement)??

      1 Reply Last reply
      0
      • U utsav_verma

        Hi guys i m having a table which primary key is char(7). i want to have last inserted row's id value but @@IDENTITY returns numeric rather character. I dnt hv ne field like time timestamp too :( Thanks in advance Utsav

        U Offline
        U Offline
        utsav_verma
        wrote on last edited by
        #3

        i think it was d stupid most question a person can ask, got d solution guys, dnt boter 4 that stupidness Utsav

        E 1 Reply Last reply
        0
        • U utsav_verma

          i think it was d stupid most question a person can ask, got d solution guys, dnt boter 4 that stupidness Utsav

          E Offline
          E Offline
          enjoycrack
          wrote on last edited by
          #4

          hi there, if u want to use @@Identity to get the last inserted record, u've to use the int field with auto increament attribute. Then, u can use this identity to retrive the info of the last inserted record << >>

          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