HOW TO GENERATE UNIQUE ID(CHARACTER + NUMBER) FOR CUSTOMER IN SQL SERVER

Поделиться
HTML-код
  • Опубликовано: 27 сен 2024
  • HERE IN THIS SQL Tutorial WE WILL GENERATE UNIQUE ID(CHARACTER + NUMBER) FOR CUSTOMER IN SQL SERVER
    HERE WE REQUIRED
    SQL SERVER MANAGEMENT STUDIO
    USING CAST,RIGHT,PERSISTED FUNCTIONALITY
    TABLE AND DATABASE

Комментарии • 30

  • @juliedecarufel3818
    @juliedecarufel3818 3 года назад +2

    How can we do that but without having the column ID and Prefix in our table when we do a select * in the table?

  • @22199610
    @22199610 3 года назад +1

    Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTITY(1,1) NOT NULL, booking_Id AS ('B' + RIGHT('00' + CAST(ID AS VARCHAR(7))' at line 2
    Getting error while implementing the same

  • @infomaxviv7008
    @infomaxviv7008 6 лет назад +2

    Good Content

  • @tiffanyurigirlsg3185
    @tiffanyurigirlsg3185 5 лет назад +1

    Finally I found this tutorial!

  • @binhnguyenam2546
    @binhnguyenam2546 4 года назад

    Thanks for your help, but I have a question: How can I get the Computed column (CustomerNo) is the primary?. I know that the computed column can't be get the primary key.

  • @Evolving_echo
    @Evolving_echo 3 года назад

    Its nice, but one question what to do if I want to generate Custom id by merging 3 columns with a auto increment id

  • @meesaqhussain3340
    @meesaqhussain3340 5 лет назад

    What is datatype of "CustomerNo"? When I pass a varchar CustomerNo to stored procedure it show this error ""Msg 245, Level 16, State 1, Procedure GetByName, Line 17
    Conversion failed when converting the varchar value 'Emp1' to data type int.
    ""

  • @manasnikam6237
    @manasnikam6237 5 лет назад +1

    Awesome !!!!! Great !!!!

  • @dondavisarroyo5625
    @dondavisarroyo5625 3 года назад

    Thank you mate!

  • @suryakanttakke3086
    @suryakanttakke3086 6 лет назад +1

    after long back son

  • @chandanv8430
    @chandanv8430 3 года назад

    Can u please do this for only integer

  • @shreyaskarkera2329
    @shreyaskarkera2329 6 лет назад

    Good comeback

  • @anandprajapati1612
    @anandprajapati1612 3 года назад

    puri table show karate bhai mujhe EmpId pr chahiye tha na ki EmpNo pr

  • @tenssports1069
    @tenssports1069 6 лет назад +1

    is this queary is applicable for sql oracle? if not what?

    • @NETTutorialsEasyWayToLearn
      @NETTutorialsEasyWayToLearn  6 лет назад

      Hey tenssports,Thanks For Asking Me Dout,Here Is The Solution Below
      Step 1 :- Create Database
      Create DataBase Demo
      Step 2 :- Create Table
      Create table Test
      (
      id int not null,
      PerFix varchar(3),
      result varchar(50),
      Primary Key (id)
      );
      Step 3 :- Create Sequence
      Create Sequence id minvalue 1 start with 1 cache 10;
      *Here You Can Start With Any Number
      Step 4 :- Insert Data
      insert into Test values(id.nextval,'SBI','SBI'+id.nextval);
      Step 5 :- Select Query
      Select *From Test
      Output :
      id PerFix result
      1 SBI SBI1

  • @mirzahaseeb4276
    @mirzahaseeb4276 4 года назад

    Thanks.

  • @mohamedzakaria9124
    @mohamedzakaria9124 5 лет назад

    Thank u so much

  • @infomudrahome3794
    @infomudrahome3794 4 года назад

    how can we do it for MYSQL ?

  • @muhammadismailmehtab
    @muhammadismailmehtab 2 года назад

    Hi sir how create I'd no with alphabet like M1,M2,M3

    • @RatulKoleyYT
      @RatulKoleyYT Год назад

      at the prefix place right whatever const value u needed like here 'M'

  • @younessmaknous3959
    @younessmaknous3959 5 лет назад

    code in mysql please

  • @Buciasda33
    @Buciasda33 3 года назад

    Good, now hack and fake the Unique ID...
    I have to merge some recovered database, initially corrupt, with a new one and still have the program think I haven't messed with it's database :)

  • @sgz7748
    @sgz7748 3 года назад

    this is really Good . i appreciate you for this kind of information.

  • @HeyItzMaeve
    @HeyItzMaeve 2 года назад

    thank you i have been searching for this the whole day !!

  • @gautamkarkera5246
    @gautamkarkera5246 6 лет назад

    Good one