I find the need to generate a code for each record that is inserted in the database and add it to the field NumberRadicate, I searched for documentation but the only one I found is the identity autoincremental but the code must have the letters concatenated AG; So the autoincremental would not work, do you have any idea how it can be done?
Thank you very much for your time.
ALTER PROCEDURE [dbo].[PRC_PRUEBA_INSERTAR]
@idRadicado int output,
@NumeroRadicado varchar (50),
@Documento varchar (100),
@TipoSoporte varchar (50),
@Remitente varchar (100),
@AsuntoFactura varchar (100),
@Destinatario varchar (100),
@Observaciones varchar (254),
@DesOpcional varchar (100)
AS
INSERT INTO tblDocumentalP (
[NumeroRadicado]
,[Fecha]
,[Documento]
,[TipoSoporte]
,[Remitente]
,[AsuntoFactura]
,[Destinatario]
,[Observaciones]
,[DesOpcional])
VALUES
(@NumeroRadicado,
SYSDATETIME(),
@Documento,
@TipoSoporte,
@Remitente,
@AsuntoFactura,
@Destinatario,
@Observaciones,
@DesOpcional)