Saturday 16 June 2018

How to add auto increament with string of number and letter?


CREATE TABLE [dbo].[tbl_Product](

[Id] [int] IDENTITY(101,1) NOT NULL,

ProductId As 'PRO'+Right('000'+convert (varchar(10),Id),6)persisted,

[ProductName] [nvarchar](100) NULL,

[Quantiy] [int] NULL,

[Price] [decimal](18, 1) NULL,

[CreateOn] [datetime] NULL
) ON [PRIMARY]


 Output-
Id ProductId ProductName Quantiy Price CreateOn
101 PRO000101 Wiproo 100 Walt Blub 100 120.0 NULL

No comments:

Post a Comment

How to get logged in User's Security Roles using Java Script in dynamic CRM 365.

 function GetloggedUser () {     var roles = Xrm.Utility.getGlobalContext().userSettings.roles;      if (roles === null) return false;      ...